X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdb%2FCloneDatabase.php;h=9eb3e2fa6149423fbb51da09373dbce814d01cb2;hb=085ca26d696d63ecd33072c9b1a9efa0a89f706d;hp=3017ea809bda5ec2bcdb94fb86696d55d669e7ba;hpb=4dbc43974514f703760e2996ae2ef5018c4a567d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 3017ea809b..9eb3e2fa61 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -91,6 +91,11 @@ 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