Move things along the DROP TABLE.
authorPlatonides <platonides@users.mediawiki.org>
Wed, 11 Aug 2010 16:50:31 +0000 (16:50 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Wed, 11 Aug 2010 16:50:31 +0000 (16:50 +0000)
maintenance/parserTests.inc

index 6a5f657..54c42fe 100644 (file)
@@ -656,7 +656,14 @@ class ParserTest {
                        $this->changePrefix( $wgDBtype != 'oracle' ? 'parsertest_' : 'pt_' );
                        $newTableName = $db->tableName( $tbl );
 
-                       if ( $db->tableExists( $tbl ) && $wgDBtype != 'postgres' && $wgDBtype != 'oracle' ) {
+                       if ( $wgDBtype == 'mysql' ) {
+                               $db->query( "DROP TABLE IF EXISTS $newTableName" );
+                       } elseif ( in_array( $wgDBtype, array( 'postgres', 'oracle' ) ) ) {
+                               /* DROPs wouldn't work due to Foreign Key Constraints (bug 14990, r58669)
+                                * Use "DROP TABLE IF EXISTS $newTableName CASCADE" for postgres? That 
+                                * syntax would also work for mysql.
+                                */
+                       } elseif ( $db->tableExists( $tbl ) ) {
                                $db->query( "DROP TABLE $newTableName" );
                        }
                        # Create new table