X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fdb%2FCloneDatabase.php;h=bc703f3658b995acdf16426ddd1f937a46681638;hb=3ae13728c4c9fe67629473a7520a9df301024936;hp=3017ea809bda5ec2bcdb94fb86696d55d669e7ba;hpb=1b8657de2ad6c533505f002dba2df8dbe7344bba;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 3017ea809b..bc703f3658 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -91,9 +91,14 @@ class CloneDatabase { if ( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres', 'oracle' ) ) ) { + if ( $oldTableName === $newTableName ) { + // Last ditch check to avoid data loss + throw new MWException( "Not dropping new table, as '$newTableName'" + . " is name of both the old and the new table." ); + } $this->db->dropTable( $tbl, __METHOD__ ); wfDebug( __METHOD__ . " dropping {$newTableName}\n" ); - //Dropping the oldTable because the prefix was changed + // Dropping the oldTable because the prefix was changed } # Create new table