r70899 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70898‎ | r70899 | r70900 >
Date:16:50, 11 August 2010
Author:platonides
Status:resolved (Comments)
Tags:
Comment:
Move things along the DROP TABLE.
Modified paths:
  • /trunk/phase3/maintenance/parserTests.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.inc
@@ -656,7 +656,14 @@
657657 $this->changePrefix( $wgDBtype != 'oracle' ? 'parsertest_' : 'pt_' );
658658 $newTableName = $db->tableName( $tbl );
659659
660 - if ( $db->tableExists( $tbl ) && $wgDBtype != 'postgres' && $wgDBtype != 'oracle' ) {
 660+ if ( $wgDBtype == 'mysql' ) {
 661+ $db->query( "DROP TABLE IF EXISTS $newTableName" );
 662+ } elseif ( in_array( $wgDBtype, array( 'postgres', 'oracle' ) ) ) {
 663+ /* DROPs wouldn't work due to Foreign Key Constraints (bug 14990, r58669)
 664+ * Use "DROP TABLE IF EXISTS $newTableName CASCADE" for postgres? That
 665+ * syntax would also work for mysql.
 666+ */
 667+ } elseif ( $db->tableExists( $tbl ) ) {
661668 $db->query( "DROP TABLE $newTableName" );
662669 }
663670 # Create new table

Comments

#Comment by Reedy (talk | contribs)   00:45, 7 January 2011

Was going to fixup the $wgDBtype, but it looks to be already changed in trunk. Marking resolved

Status & tagging log