Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -642,11 +642,13 @@ |
643 | 643 | # Split database and table into proper variables. |
644 | 644 | # We reverse the explode so that schema.table and table both output |
645 | 645 | # the correct table. |
646 | | - $dbDetails = array_reverse( explode( '.', $name, 2 ) ); |
| 646 | + $dbDetails = explode( '.', $name, 2 ); |
647 | 647 | if ( isset( $dbDetails[1] ) ) { |
648 | | - list( $table, $schema ) = $dbDetails; |
| 648 | + $schema = '"' . $dbDetails[0] . '".'; |
| 649 | + $table = $dbDetails [1]; |
649 | 650 | } else { |
650 | | - list( $table ) = $dbDetails; |
| 651 | + $schema = "\"{$wgDBmwschema}\"."; # keep old schema, but quote it. |
| 652 | + $table = $dbDetails[0]; |
651 | 653 | } |
652 | 654 | if ( $format != 'quoted' ) { |
653 | 655 | switch( $name ) { |
— | — | @@ -658,12 +660,7 @@ |
659 | 661 | return $table; |
660 | 662 | } |
661 | 663 | } |
662 | | - if ( !isset( $schema )) { |
663 | | - $schema = "\"{$wgDBmwschema}\"."; |
664 | | - } else { |
665 | | - # keep old schema, but quote it. |
666 | | - $schema = "\"{$schema}\"."; |
667 | | - } |
| 664 | + |
668 | 665 | # during installation wgDBmwschema is not set, so we would end up quering |
669 | 666 | # ""."table" => error. Erase the first part if wgDBmwschema is empty |
670 | 667 | if ( $schema == "\"\"." ) { |