Merge "Handle missing namespace prefix in XML dumps more gracefully"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / Database.php
index 9d800a2..e807bc8 100644 (file)
@@ -29,8 +29,10 @@ use Wikimedia\ScopedCallback;
 use Wikimedia\Rdbms\TransactionProfiler;
 use Wikimedia\Rdbms\LikeMatch;
 use Wikimedia\Rdbms\DatabaseDomain;
+use Wikimedia\Rdbms\ResultWrapper;
 use Wikimedia\Rdbms\DBMasterPos;
 use Wikimedia\Rdbms\Blob;
+use Wikimedia\Timestamp\ConvertibleTimestamp;
 
 /**
  * Relational database abstraction object
@@ -846,7 +848,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                }
 
                // Add trace comment to the begin of the sql string, right after the operator.
-               // Or, for one-word queries (like "BEGIN" or COMMIT") add it to the end (bug 42598)
+               // Or, for one-word queries (like "BEGIN" or COMMIT") add it to the end (T44598)
                $commentedSql = preg_replace( '/\s|$/', " /* $fname {$this->agent} */ ", $sql, 1 );
 
                # Start implicit transactions that wrap the request if DBO_TRX is enabled
@@ -1025,8 +1027,8 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
        private function handleSessionLoss() {
                $this->mTrxLevel = 0;
-               $this->mTrxIdleCallbacks = []; // bug 65263
-               $this->mTrxPreCommitCallbacks = []; // bug 65263
+               $this->mTrxIdleCallbacks = []; // T67263
+               $this->mTrxPreCommitCallbacks = []; // T67263
                $this->mSessionTempTables = [];
                $this->mNamedLocksHeld = [];
                try {
@@ -1141,12 +1143,6 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
                $preLimitTail .= $this->makeOrderBy( $options );
 
-               // if (isset($options['LIMIT'])) {
-               //      $tailOpts .= $this->limitResult('', $options['LIMIT'],
-               //              isset($options['OFFSET']) ? $options['OFFSET']
-               //              : false);
-               // }
-
                if ( isset( $noKeyOptions['FOR UPDATE'] ) ) {
                        $postLimitTail .= ' FOR UPDATE';
                }
@@ -3416,7 +3412,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
         */
        public function __clone() {
                $this->connLogger->warning(
-                       "Cloning " . get_class( $this ) . " is not recomended; forking connection:\n" .
+                       "Cloning " . static::class . " is not recomended; forking connection:\n" .
                        ( new RuntimeException() )->getTraceAsString()
                );
 
@@ -3467,4 +3463,4 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
        }
 }
 
-class_alias( 'Database', 'DatabaseBase' );
+class_alias( Database::class, 'DatabaseBase' );