Follow up r85888: Add the parameter to DatabasePostgres.php and DatabaseOracle.php
authorPlatonides <platonides@users.mediawiki.org>
Tue, 12 Apr 2011 18:59:19 +0000 (18:59 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Tue, 12 Apr 2011 18:59:19 +0000 (18:59 +0000)
Follow up r85884: The parent tableName() should work now for DatabaseMssql.php

includes/db/DatabaseMssql.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php

index e1f265b..1bc20ee 100644 (file)
@@ -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()
         */
index a1dc46f..36ffdfb 100644 (file)
@@ -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 );
        }
 
        /**
index a1c1d14..a14bcc0 100644 (file)
@@ -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 );
                }
        }