Follow up r79314.
authorPlatonides <platonides@users.mediawiki.org>
Fri, 31 Dec 2010 14:08:10 +0000 (14:08 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Fri, 31 Dec 2010 14:08:10 +0000 (14:08 +0000)
The table to drop is the NEW one, the one that is going to be recreated.
Sure, the prefix was changed, which means that we need just the table base.

The r79314 behavior was to perform the following:
 DROP /* CloneDatabase::cloneTableStructure  */ TABLE IF EXISTS `archive`
 CREATE /* DatabaseMysql::duplicateTableStructure  */ TEMPORARY  TABLE `unittest_archive` (LIKE `archive`)

Luckily, it failed there as it didn't find the table it had just dropped.

includes/db/CloneDatabase.php

index 4d22452..9e1f05c 100644 (file)
@@ -96,9 +96,9 @@ class CloneDatabase {
                        
                        $this->changePrefix( $this->newTablePrefix );
                        $newTableName = $this->db->tableName( $tbl );
-                       
-                       if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres') ) ) {
-                               $this->db->dropTable( $oldTableName, __METHOD__ );
+
+                       if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres' ) ) ) {
+                               $this->db->dropTable( $tbl, __METHOD__ );
                                //Dropping the oldTable because the prefix was changed
                        }