Merge "Warn if stateful ParserOutput transforms are used"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / DatabaseMssql.php
index 4ebc623..832ed9e 100644 (file)
@@ -353,7 +353,7 @@ class DatabaseMssql extends Database {
        /**
         * @return int
         */
-       public function affectedRows() {
+       protected function fetchAffectedRowCount() {
                return $this->mAffectedRows;
        }
 
@@ -440,8 +440,14 @@ class DatabaseMssql extends Database {
                if ( strpos( $sql, 'MAX(' ) !== false || strpos( $sql, 'MIN(' ) !== false ) {
                        $bitColumns = [];
                        if ( is_array( $table ) ) {
-                               foreach ( $table as $t ) {
-                                       $bitColumns += $this->getBitColumns( $this->tableName( $t ) );
+                               $tables = $table;
+                               while ( $tables ) {
+                                       $t = array_pop( $tables );
+                                       if ( is_array( $t ) ) {
+                                               $tables = array_merge( $tables, $t );
+                                       } else {
+                                               $bitColumns += $this->getBitColumns( $this->tableName( $t ) );
+                                       }
                                }
                        } else {
                                $bitColumns = $this->getBitColumns( $this->tableName( $table ) );
@@ -1065,7 +1071,6 @@ class DatabaseMssql extends Database {
         */
        public function strencode( $s ) {
                // Should not be called by us
-
                return str_replace( "'", "''", $s );
        }