From bdbe39d28cd9fafa3abfb6fd4556fc665fb856f5 Mon Sep 17 00:00:00 2001 From: Platonides Date: Tue, 12 Apr 2011 18:59:19 +0000 Subject: [PATCH] Follow up r85888: Add the parameter to DatabasePostgres.php and DatabaseOracle.php Follow up r85884: The parent tableName() should work now for DatabaseMssql.php --- includes/db/DatabaseMssql.php | 29 ----------------------------- includes/db/DatabaseOracle.php | 5 ++--- includes/db/DatabasePostgres.php | 4 ++-- 3 files changed, 4 insertions(+), 34 deletions(-) diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index e1f265bd62..1bc20eea37 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -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() */ diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index a1dc46f66c..36ffdfb32a 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -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 ); } /** diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index a1c1d14ab7..a14bcc095c 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -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 ); } } -- 2.20.1