Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -624,59 +624,15 @@ |
625 | 625 | } |
626 | 626 | |
627 | 627 | function tableName( $name, $format = 'quoted' ) { |
628 | | - global $wgSharedDB, $wgSharedTables; |
629 | | - # Skip quoted tablenames. |
630 | | - if ( $this->isQuotedIdentifier( $name ) ) { |
631 | | - return $name; |
632 | | - } |
633 | | - # Lets test for any bits of text that should never show up in a table |
634 | | - # name. Basically anything like JOIN or ON which are actually part of |
635 | | - # SQL queries, but may end up inside of the table value to combine |
636 | | - # sql. Such as how the API is doing. |
637 | | - # Note that we use a whitespace test rather than a \b test to avoid |
638 | | - # any remote case where a word like on may be inside of a table name |
639 | | - # surrounded by symbols which may be considered word breaks. |
640 | | - if ( preg_match( '/(^|\s)(DISTINCT|JOIN|ON|AS)(\s|$)/i', $name ) !== 0 ) { |
641 | | - return $name; |
642 | | - } |
643 | | - # Extract the database prefix, if any and quote it |
644 | | - $dbDetails = explode( '.', $name, 2 ); |
645 | | - if ( isset( $dbDetails[1] ) ) { |
646 | | - $schema = '"' . $dbDetails[0] . '".'; |
647 | | - $table = $dbDetails[1]; |
648 | | - } else { |
649 | | - $schema = ""; # do NOT force the schema (due to temporary tables) |
650 | | - $table = $dbDetails[0]; |
651 | | - } |
652 | | - if ( $format != 'quoted' ) { |
653 | | - switch( $name ) { |
654 | | - case 'user': |
655 | | - return 'mwuser'; |
656 | | - case 'text': |
657 | | - return 'pagecontent'; |
658 | | - default: |
659 | | - return $table; |
660 | | - } |
661 | | - } |
662 | | - |
663 | | - if ( isset( $wgSharedDB ) # We have a shared database (=> schema) |
664 | | - && isset( $wgSharedTables ) |
665 | | - && is_array( $wgSharedTables ) |
666 | | - && in_array( $table, $wgSharedTables ) ) { # A shared table is selected |
667 | | - $schema = "\"{$wgSharedDB}\"."; |
668 | | - } |
669 | | - switch ( $table ) { |
| 628 | + # Replace reserved words with better ones |
| 629 | + switch( $name ) { |
670 | 630 | case 'user': |
671 | | - $table = "{$schema}\"mwuser\""; |
672 | | - break; |
| 631 | + return 'mwuser'; |
673 | 632 | case 'text': |
674 | | - $table = "{$schema}\"pagecontent\""; |
675 | | - break; |
| 633 | + return 'pagecontent'; |
676 | 634 | default: |
677 | | - $table = "{$schema}\"$table\""; |
678 | | - break; |
| 635 | + return parent::tableName( $name, $format ); |
679 | 636 | } |
680 | | - return $table; |
681 | 637 | } |
682 | 638 | |
683 | 639 | /** |
Index: trunk/phase3/CREDITS |
— | — | @@ -123,7 +123,6 @@ |
124 | 124 | * Lejonel |
125 | 125 | * liangent |
126 | 126 | * Louperivois |
127 | | -* Luca Fulchir |
128 | 127 | * Lucas Garczewski |
129 | 128 | * Luigi Corsaro |
130 | 129 | * Lupo |