From: Brian Wolff Date: Thu, 22 May 2014 21:36:40 +0000 (-0300) Subject: Make CloneDatabase error out on shared tables. X-Git-Tag: 1.31.0-rc.0~15340 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=0b32b01adbbbf325e575f1da08104a36fb315759;p=lhc%2Fweb%2Fwiklou.git Make CloneDatabase error out on shared tables. Due to the way prefixes are handled, this doesn't work properly. Make it quit early to prevent confusion. I don't think there's many people who need shared table support, so I don't know if its worth the effort to actually fix. Bug: 65654 Change-Id: I6cd701998fc9066d8c7a4fc86d93a4282cc7f9bd --- diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 536d721fb2..3017ea809b 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -71,7 +71,13 @@ class CloneDatabase { * Clone the table structure */ public function cloneTableStructure() { + global $wgSharedTables, $wgSharedDB; foreach ( $this->tablesToClone as $tbl ) { + if ( $wgSharedDB && in_array( $tbl, $wgSharedTables, true ) ) { + // Shared tables don't work properly when cloning due to + // how prefixes are handled (bug 65654) + throw new MWException( "Cannot clone shared table $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.