Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | AND attname=%s; |
41 | 41 | SQL; |
42 | 42 | |
43 | | - $table = $db->tableName( $table ); |
| 43 | + $table = $db->tableName( $table, false ); |
44 | 44 | $res = $db->query( |
45 | 45 | sprintf( $q, |
46 | 46 | $db->addQuotes( $wgDBmwschema ), |
— | — | @@ -819,7 +819,7 @@ |
820 | 820 | if ( !$schema ) { |
821 | 821 | $schema = $wgDBmwschema; |
822 | 822 | } |
823 | | - $table = $this->tableName( $table ); |
| 823 | + $table = $this->tableName( $table, false ); |
824 | 824 | $etable = $this->addQuotes( $table ); |
825 | 825 | $eschema = $this->addQuotes( $schema ); |
826 | 826 | $SQL = "SELECT 1 FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n " |
— | — | @@ -1002,13 +1002,21 @@ |
1003 | 1003 | } |
1004 | 1004 | |
1005 | 1005 | if ( isset( $options['GROUP BY'] ) ) { |
1006 | | - $preLimitTail .= ' GROUP BY ' . $options['GROUP BY']; |
| 1006 | + $gb = is_array( $options['GROUP BY'] ) |
| 1007 | + ? implode( ',', $options['GROUP BY'] ) |
| 1008 | + : $options['GROUP BY']; |
| 1009 | + $preLimitTail .= " GROUP BY {$gb}"; |
1007 | 1010 | } |
| 1011 | + |
1008 | 1012 | if ( isset( $options['HAVING'] ) ) { |
1009 | 1013 | $preLimitTail .= " HAVING {$options['HAVING']}"; |
1010 | 1014 | } |
| 1015 | + |
1011 | 1016 | if ( isset( $options['ORDER BY'] ) ) { |
1012 | | - $preLimitTail .= ' ORDER BY ' . $options['ORDER BY']; |
| 1017 | + $ob = is_array( $options['ORDER BY'] ) |
| 1018 | + ? implode( ',', $options['ORDER BY'] ) |
| 1019 | + : $options['ORDER BY']; |
| 1020 | + $preLimitTail .= " ORDER BY {$ob}"; |
1013 | 1021 | } |
1014 | 1022 | |
1015 | 1023 | //if ( isset( $options['LIMIT'] ) ) { |