Merge "Soft deprecation of DatabaseMysql"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 22 Aug 2017 10:51:24 +0000 (10:51 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 22 Aug 2017 10:51:24 +0000 (10:51 +0000)
1  2 
RELEASE-NOTES-1.30
includes/libs/rdbms/database/Database.php

diff --combined RELEASE-NOTES-1.30
@@@ -33,6 -33,10 +33,10 @@@ section)
    use $wgFragmentMode to migrate off it to a modern alternative.
  * $wgExternalInterwikiFragmentMode was introduced to control how fragments in
    sinterwikis going outside of current wiki farm are encoded.
+ * (T120333) Soft-deprecated the use of PHP extension 'mysql' in favor of 'mysqli'.
+   This PHP extension was deprecated in PHP 5.5 and removed in PHP 7.0. MediaWiki
+   auto-selects the 'mysqli' driver since MediaWiki 1.22, except if explicitly
+   requested through the configuration parameter $wgDBservers.
  
  === New features in 1.30 ===
  * (T37247) Output from Parser::parse() will now be wrapped in a div with
  * Added RecentChangesPurgeRows hook to allow extensions to purge data that
    depends on the recentchanges table.
  * Added JS config values wgDiffOldId/wgDiffNewId to the output of diff pages.
 +* (T2424) Added direct unwatch links to entries in Special:Watchlist (if the
 +  'watchlistunwatchlinks' preference option is enabled). With JavaScript
 +  enabled, these links toggle so the user can also re-watch pages that have
 +  just been unwatched.
 +* Added $wgParserTestMediaHandlers, where mock media handlers can be passed to
 +  MediaHandlerFactory for parser tests.
  
  === Languages updated in 1.30 ===
  
@@@ -164,13 -162,6 +168,13 @@@ changes to languages because of Phabric
    nothing and is deprecated.
  * mw.util.escapeId() was deprecated, use escapeIdForAttribute() or
    escapeIdForLink().
 +* MagicWord::replaceMultiple() (deprecated in 1.25) was removed.
 +* WikiImporter now requires the second parameter to be an instance of the Config,
 +  class. Prior to that, the Config parameter was optional (a behavior deprecated in
 +  1.25).
 +* Removed 'jquery.mwExtension' module. (deprecated since 1.26)
 +* mediawiki.ui: Deprecate greys, which are not part of WikimediaUI color palette
 +  any more.
  
  == Compatibility ==
  MediaWiki 1.30 requires PHP 5.5.9 or later. There is experimental support for
@@@ -108,7 -108,7 +108,7 @@@ abstract class Database implements IDat
        protected $mTablePrefix = '';
        /** @var string */
        protected $mSchema = '';
 -      /** @var integer */
 +      /** @var int */
        protected $mFlags;
        /** @var array */
        protected $mLBInfo = [];
         */
        private $mTrxWriteDuration = 0.0;
        /**
 -       * @var integer Number of write queries for the current transaction
 +       * @var int Number of write queries for the current transaction
         */
        private $mTrxWriteQueryCount = 0;
        /**
 -       * @var integer Number of rows affected by write queries for the current transaction
 +       * @var int Number of rows affected by write queries for the current transaction
         */
        private $mTrxWriteAffectedRows = 0;
        /**
         */
        private $mTrxWriteAdjDuration = 0.0;
        /**
 -       * @var integer Number of write queries counted in mTrxWriteAdjDuration
 +       * @var int Number of write queries counted in mTrxWriteAdjDuration
         */
        private $mTrxWriteAdjQueryCount = 0;
        /**
  
                        $closed = $this->closeConnection();
                        $this->mConn = false;
 -              } elseif ( $this->mTrxIdleCallbacks || $this->mTrxEndCallbacks ) { // sanity
 +              } elseif (
 +                      $this->mTrxIdleCallbacks ||
 +                      $this->mTrxPreCommitCallbacks ||
 +                      $this->mTrxEndCallbacks
 +              ) { // sanity
                        throw new RuntimeException( "Transaction callbacks still pending." );
                } else {
                        $closed = true;
        }
  
        /**
 -       * @param $sql
 +       * @param string $sql
         * @return string|null
         */
        protected function getQueryVerb( $sql ) {
         *
         * @param string $sql A SQL write query
         * @param float $runtime Total runtime, including RTT
 -       * @param integer $affected Affected row count
 +       * @param int $affected Affected row count
         */
        private function updateTrxWriteQueryTime( $sql, $runtime, $affected ) {
                // Whether this is indicative of replica DB runtime (except for RBR or ws_repl)
         * Quotes an identifier using `backticks` or "double quotes" depending on the database type.
         * MySQL uses `backticks` while basically everything else uses double quotes.
         * Since MySQL is the odd one out here the double quotes are our generic
-        * and we implement backticks in DatabaseMysql.
+        * and we implement backticks in DatabaseMysqlBase.
         *
         * @param string $s
         * @return string
        /**
         * Do not use this method outside of Database/DBError classes
         *
 -       * @param integer|string $errno
 +       * @param int|string $errno
         * @return bool Whether the given query error was a connection drop
         */
        public function wasConnectionError( $errno ) {
         *
         * This method should not be used outside of Database/LoadBalancer
         *
 -       * @param integer $trigger IDatabase::TRIGGER_* constant
 +       * @param int $trigger IDatabase::TRIGGER_* constant
         * @since 1.20
         * @throws Exception
         */
         *
         * This method should not be used outside of Database/LoadBalancer
         *
 -       * @param integer $trigger IDatabase::TRIGGER_* constant
 +       * @param int $trigger IDatabase::TRIGGER_* constant
         * @throws Exception
         * @since 1.20
         */
         * @see WANObjectCache::getWithSetCallback()
         *
         * @param IDatabase $db1
 -       * @param IDatabase ...
 +       * @param IDatabase $dbs,...
         * @return array Map of values:
         *   - lag: highest lag of any of the DBs or false on error (e.g. replication stopped)
         *   - since: oldest UNIX timestamp of any of the DB lag estimates