From: Platonides Date: Fri, 31 Dec 2010 14:08:10 +0000 (+0000) Subject: Follow up r79314. X-Git-Tag: 1.31.0-rc.0~32963 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=666ee2902af3823e25379355f5df3b1ab20a11a4;p=lhc%2Fweb%2Fwiklou.git Follow up r79314. 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. --- diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 4d22452cb4..9e1f05c5c0 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -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 }