namespace Wikimedia\Rdbms;
-use MediaWiki;
+use Wikimedia;
use Exception;
use stdClass;
$connectionInfo['PWD'] = $password;
}
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
$this->mConn = sqlsrv_connect( $server, $connectionInfo );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
if ( $this->mConn === false ) {
throw new DBConnectionError( $this, $this->lastError() );
/**
* @return int
*/
- public function affectedRows() {
+ protected function fetchAffectedRowCount() {
return $this->mAffectedRows;
}
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 ) );
*/
public function strencode( $s ) {
// Should not be called by us
-
return str_replace( "'", "''", $s );
}