From f70c2b987c4d08812c3790168cd45160df21aaf4 Mon Sep 17 00:00:00 2001 From: X! Date: Fri, 31 Dec 2010 02:18:25 +0000 Subject: [PATCH] Use $oldTableName in CloneDatabase. The dropTable() appends the prefix, so $oldTableName becomes $newTableName --- includes/db/CloneDatabase.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 6ca06938ba..4d22452cb4 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -85,21 +85,21 @@ class CloneDatabase { * Clone the table structure */ public function cloneTableStructure() { - - sort($this->tablesToClone); foreach( $this->tablesToClone as $tbl ) { # Clean up from previous aborted run. So that table escaping # works correctly across DB engines, we need to change the pre- # fix back and forth so tableName() works right. + $this->changePrefix( $this->oldTablePrefix ); $oldTableName = $this->db->tableName( $tbl ); $this->changePrefix( $this->newTablePrefix ); $newTableName = $this->db->tableName( $tbl ); - + if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres') ) ) { - $this->db->dropTable( $newTableName, __METHOD__ ); + $this->db->dropTable( $oldTableName, __METHOD__ ); + //Dropping the oldTable because the prefix was changed } # Create new table @@ -107,6 +107,7 @@ class CloneDatabase { $this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables ); } + } /** -- 2.20.1