Index: trunk/phase3/maintenance/parserTests.inc |
— | — | @@ -616,7 +616,7 @@ |
617 | 617 | * the db will be visible to later tests in the run. |
618 | 618 | */ |
619 | 619 | private function setupDatabase() { |
620 | | - global $wgDBprefix; |
| 620 | + global $wgDBprefix, $wgDBtype; |
621 | 621 | if ( $this->databaseSetupDone ) { |
622 | 622 | return; |
623 | 623 | } |
— | — | @@ -638,15 +638,16 @@ |
639 | 639 | $db = wfGetDB( DB_MASTER ); |
640 | 640 | $tables = $this->listTables(); |
641 | 641 | |
642 | | - if (!(strcmp($db->getServerVersion(), '4.1') < 0 and stristr($db->getSoftwareLink(), 'MySQL'))) { |
| 642 | + if ( !( $wgDBtype == 'mysql' && strcmp( $db->getServerVersion(), '4.1' ) < 0 ) ) { |
643 | 643 | # Database that supports CREATE TABLE ... LIKE |
644 | | - global $wgDBtype; |
| 644 | + |
645 | 645 | if( $wgDBtype == 'postgres' ) { |
646 | 646 | $def = 'INCLUDING DEFAULTS'; |
| 647 | + $temporary = 'TEMPORARY'; |
647 | 648 | } else { |
648 | 649 | $def = ''; |
649 | 650 | } |
650 | | - foreach ($tables as $tbl) { |
| 651 | + foreach ( $tables as $tbl ) { |
651 | 652 | # Clean up from previous aborted run. So that table escaping |
652 | 653 | # works correctly across DB engines, we need to change the pre- |
653 | 654 | # fix back and forth so tableName() works right. |
— | — | @@ -655,11 +656,11 @@ |
656 | 657 | $this->changePrefix( 'parsertest_' ); |
657 | 658 | $newTableName = $db->tableName( $tbl ); |
658 | 659 | |
659 | | - if ( $db->tableExists( $tbl ) ) { |
660 | | - $db->query("DROP TABLE $newTableName"); |
| 660 | + if ( $db->tableExists( $tbl ) && $wgDBtype != 'postgres' ) { |
| 661 | + $db->query( "DROP TABLE $newTableName" ); |
661 | 662 | } |
662 | 663 | # Create new table |
663 | | - $db->query("CREATE $temporary TABLE $newTableName (LIKE $oldTableName $def)"); |
| 664 | + $db->query( "CREATE $temporary TABLE $newTableName (LIKE $oldTableName $def)" ); |
664 | 665 | } |
665 | 666 | } else { |
666 | 667 | # Hack for MySQL versions < 4.1, which don't support |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -269,6 +269,7 @@ |
270 | 270 | don't use PathInfo or short urls |
271 | 271 | * (bug 17990) trackback.php now has a trackback.php5 alias and works with |
272 | 272 | $wgScriptExtension |
| 273 | +* (bug 14990) Parser tests works again with PostgreSQL |
273 | 274 | |
274 | 275 | == API changes in 1.15 == |
275 | 276 | * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions |