Follow up r85888: Add the parameter to DatabasePostgres.php and DatabaseOracle.php
Follow up r85884: The parent tableName() should work now for DatabaseMssql.php
This commit is contained in:
parent
f524482f2d
commit
bdbe39d28c
3 changed files with 4 additions and 34 deletions
|
|
@ -509,35 +509,6 @@ class DatabaseMssql extends DatabaseBase {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a table name ready for use in constructing an SQL query
|
||||
*
|
||||
* This does two important things: it brackets table names which as necessary,
|
||||
* and it adds a table prefix if there is one.
|
||||
*
|
||||
* All functions of this object which require a table name call this function
|
||||
* themselves. Pass the canonical name to such functions. This is only needed
|
||||
* when calling query() directly.
|
||||
*
|
||||
* @param $name String: database table name
|
||||
*/
|
||||
function tableName( $name ) {
|
||||
global $wgSharedDB;
|
||||
# Skip quoted literals
|
||||
if ( $name != '' && $name { 0 } != '[' ) {
|
||||
if ( $this->mTablePrefix !== '' && strpos( '.', $name ) === false ) {
|
||||
$name = "{$this->mTablePrefix}$name";
|
||||
}
|
||||
if ( isset( $wgSharedDB ) && "{$this->mTablePrefix}user" == $name ) {
|
||||
$name = "[$wgSharedDB].[$name]";
|
||||
} else {
|
||||
# Standard quoting
|
||||
if ( $name != '' ) $name = "[$name]";
|
||||
}
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the next in a sequence, save the value for retrieval via insertId()
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -632,8 +632,7 @@ class DatabaseOracle extends DatabaseBase {
|
|||
return $retval;
|
||||
}
|
||||
|
||||
function tableName( $name ) {
|
||||
global $wgSharedDB, $wgSharedPrefix, $wgSharedTables;
|
||||
function tableName( $name, $quoted ) {
|
||||
/*
|
||||
Replace reserved words with better ones
|
||||
Using uppercase because that's the only way Oracle can handle
|
||||
|
|
@ -648,7 +647,7 @@ class DatabaseOracle extends DatabaseBase {
|
|||
break;
|
||||
}
|
||||
|
||||
return parent::tableName( strtoupper( $name ) );
|
||||
return parent::tableName( strtoupper( $name ), $quoted );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ class DatabasePostgres extends DatabaseBase {
|
|||
return $res;
|
||||
}
|
||||
|
||||
function tableName( $name ) {
|
||||
function tableName( $name, $quoted = true ) {
|
||||
# Replace reserved words with better ones
|
||||
switch( $name ) {
|
||||
case 'user':
|
||||
|
|
@ -619,7 +619,7 @@ class DatabasePostgres extends DatabaseBase {
|
|||
case 'text':
|
||||
return 'pagecontent';
|
||||
default:
|
||||
return $name;
|
||||
return parent::tableName( $name, $quoted );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue