rv r87948 "fix backtrace on SQL error"
[lhc/web/wiklou.git] / includes / db / DatabasePostgres.php
index 222e3c1..2f0cdb4 100644 (file)
@@ -624,7 +624,7 @@ class DatabasePostgres extends DatabaseBase {
        }
 
        function tableName( $name, $format = 'quoted' ) {
-               global $wgSharedDB, $wgSharedTables, $wgDBmwschema;
+               global $wgSharedDB, $wgSharedTables;
                # Skip quoted tablenames.
                if ( $this->isQuotedIdentifier( $name ) ) {
                        return $name;
@@ -643,9 +643,9 @@ class DatabasePostgres extends DatabaseBase {
                $dbDetails = explode( '.', $name, 2 );
                if ( isset( $dbDetails[1] ) ) {
                        $schema = '"' . $dbDetails[0] . '".';
-                       $table  = $dbDetails [1];
+                       $table  = $dbDetails[1];
                } else {
-                       $schema = "\"{$wgDBmwschema}\"."; # keep old schema, but quote it.
+                       $schema = ""; # do NOT force the schema (due to temporary tables)
                        $table = $dbDetails[0];
                }
                if ( $format != 'quoted' ) {
@@ -659,11 +659,6 @@ class DatabasePostgres extends DatabaseBase {
                        }
                }
 
-               # during installation wgDBmwschema is not set, so we would end up quering
-               # ""."table" => error. Erase the first part if wgDBmwschema is empty
-               if ( $schema == "\"\"." ) {
-                       $schema = "";
-               }
                if ( isset( $wgSharedDB ) # We have a shared database (=> schema)
                  && isset( $wgSharedTables )
                  && is_array( $wgSharedTables )
@@ -1051,7 +1046,7 @@ SQL;
                return 'SearchPostgres';
        }
 
-       protected function streamStatementEnd( &$sql, &$newLine ) {
+       public function streamStatementEnd( &$sql, &$newLine ) {
                # Allow dollar quoting for function declarations
                if ( substr( $newLine, 0, 4 ) == '$mw$' ) {
                        if ( $this->delimiter ) {