r79314 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79313‎ | r79314 | r79315 >
Date:02:18, 31 December 2010
Author:soxred93
Status:resolved
Tags:
Comment:
Use $oldTableName in CloneDatabase. The dropTable() appends the prefix, so $oldTableName becomes $newTableName
Modified paths:
  • /trunk/phase3/includes/db/CloneDatabase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/CloneDatabase.php
@@ -85,21 +85,21 @@
8686 * Clone the table structure
8787 */
8888 public function cloneTableStructure() {
89 -
90 - sort($this->tablesToClone);
9189
9290 foreach( $this->tablesToClone as $tbl ) {
9391 # Clean up from previous aborted run. So that table escaping
9492 # works correctly across DB engines, we need to change the pre-
9593 # fix back and forth so tableName() works right.
 94+
9695 $this->changePrefix( $this->oldTablePrefix );
9796 $oldTableName = $this->db->tableName( $tbl );
9897
9998 $this->changePrefix( $this->newTablePrefix );
10099 $newTableName = $this->db->tableName( $tbl );
101 -
 100+
102101 if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres') ) ) {
103 - $this->db->dropTable( $newTableName, __METHOD__ );
 102+ $this->db->dropTable( $oldTableName, __METHOD__ );
 103+ //Dropping the oldTable because the prefix was changed
104104 }
105105
106106 # Create new table
@@ -107,6 +107,7 @@
108108 $this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables );
109109
110110 }
 111+
111112 }
112113
113114 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r79337Follow up r79314....platonides14:08, 31 December 2010

Status & tagging log