rdbms: ignore DBO_IGNORE if passed into Database::__construct()
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 24 Mar 2018 12:17:12 +0000 (05:17 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 24 Mar 2018 12:32:42 +0000 (12:32 +0000)
Bug: T189999
Change-Id: I46369709a850acd85fe7d46da554514615f51300

includes/libs/rdbms/database/Database.php

index 5f2bbdb..00d9b0b 100644 (file)
@@ -283,6 +283,8 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                                $this->flags |= self::DBO_TRX;
                        }
                }
+               // Disregard deprecated DBO_IGNORE flag (T189999)
+               $this->flags &= ~self::DBO_IGNORE;
 
                $this->sessionVars = $params['variables'];
 
@@ -1278,7 +1280,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
         * @throws DBQueryError
         */
        public function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
-               if ( $this->getFlag( self::DBO_IGNORE ) || $tempIgnore ) {
+               if ( $tempIgnore ) {
                        $this->queryLogger->debug( "SQL ERROR (ignored): $error\n" );
                } else {
                        $sql1line = mb_substr( str_replace( "\n", "\\n", $sql ), 0, 5 * 1024 );