protected $sqlMode;
/** @var bool Use experimental UTF-8 transmission encoding */
protected $utf8Mode;
+ /** @var bool|null */
+ protected $defaultBigSelects = null;
/** @var string|null */
private $serverVersion = null;
# Close/unset connection handle
$this->close();
- $this->mServer = $server;
- $this->mUser = $user;
- $this->mPassword = $password;
- $this->mDBname = $dbName;
+ $this->server = $server;
+ $this->user = $user;
+ $this->password = $password;
+ $this->dbName = $dbName;
$this->installErrorHandler();
try {
- $this->mConn = $this->mysqlConnect( $this->mServer );
+ $this->conn = $this->mysqlConnect( $this->server );
} catch ( Exception $ex ) {
$this->restoreErrorHandler();
throw $ex;
$error = $this->restoreErrorHandler();
# Always log connection errors
- if ( !$this->mConn ) {
+ if ( !$this->conn ) {
if ( !$error ) {
$error = $this->lastError();
}
] )
);
$this->queryLogger->debug(
- "Error selecting database $dbName on server {$this->mServer}" );
+ "Error selecting database $dbName on server {$this->server}" );
$this->reportConnectionError( "Error selecting database $dbName" );
}
}
// Set any custom settings defined by site config
// (e.g. https://dev.mysql.com/doc/refman/4.1/en/innodb-parameters.html)
- foreach ( $this->mSessionVars as $var => $val ) {
+ foreach ( $this->sessionVars as $var => $val ) {
// Escape strings but not numbers to avoid MySQL complaining
if ( !is_int( $val ) && !is_float( $val ) ) {
$val = $this->addQuotes( $val );
}
}
- $this->mOpened = true;
+ $this->opened = true;
return true;
}
* @return string
*/
public function lastError() {
- if ( $this->mConn ) {
+ if ( $this->conn ) {
# Even if it's non-zero, it can still be invalid
Wikimedia\suppressWarnings();
- $error = $this->mysqlError( $this->mConn );
+ $error = $this->mysqlError( $this->conn );
if ( !$error ) {
$error = $this->mysqlError();
}
$error = $this->mysqlError();
}
if ( $error ) {
- $error .= ' (' . $this->mServer . ')';
+ $error .= ' (' . $this->server . ')';
}
return $error;
list( $database, , $prefix, $table ) = $this->qualifiedTableComponents( $table );
$tableName = "{$prefix}{$table}";
- if ( isset( $this->mSessionTempTables[$tableName] ) ) {
+ if ( isset( $this->sessionTempTables[$tableName] ) ) {
return true; // already known to exist and won't show in SHOW TABLES anyway
}
*/
public function setBigSelects( $value = true ) {
if ( $value === 'default' ) {
- if ( $this->mDefaultBigSelects === null ) {
+ if ( $this->defaultBigSelects === null ) {
# Function hasn't been called before so it must already be set to the default
return;
} else {
- $value = $this->mDefaultBigSelects;
+ $value = $this->defaultBigSelects;
}
- } elseif ( $this->mDefaultBigSelects === null ) {
- $this->mDefaultBigSelects =
+ } elseif ( $this->defaultBigSelects === null ) {
+ $this->defaultBigSelects =
(bool)$this->selectField( false, '@@sql_big_selects', '', __METHOD__ );
}
$encValue = $value ? '1' : '0';
*/
public function listViews( $prefix = null, $fname = __METHOD__ ) {
// The name of the column containing the name of the VIEW
- $propertyName = 'Tables_in_' . $this->mDBname;
+ $propertyName = 'Tables_in_' . $this->dbName;
// Query for the VIEWS
$res = $this->query( 'SHOW FULL TABLES WHERE TABLE_TYPE = "VIEW"' );