From: Kevin Israel Date: Fri, 26 Aug 2016 09:09:12 +0000 (-0400) Subject: Remove patch-pl-tl-il-unique.sql X-Git-Tag: 1.31.0-rc.0~5876 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=c1079140e48537af134cb3449276b1f65c2e9577;p=lhc%2Fweb%2Fwiklou.git Remove patch-pl-tl-il-unique.sql In 1.24 (b8c038f6784ef082), this update from 1.15 (see T18645, 640a6d311e91ccdc) was undone in tables.sql. However, it was not removed from MysqlUpdater, so update.php would still make the indices UNIQUE, even when run on a new MediaWiki installation. In its place, added patch-pl-tl-il-nonunique.sql, which recreates the indices to match the current definitions from tables.sql. Bug: T78513 Change-Id: Ic82ca06c8e7051bcd1e0a2a3d5d251e297a9142f --- diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 6989969187..65af086e08 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -155,7 +155,6 @@ class MysqlUpdater extends DatabaseUpdater { [ 'addField', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ], // 1.15 - [ 'doUniquePlTlIl' ], [ 'addTable', 'change_tag', 'patch-change_tag.sql' ], [ 'addTable', 'tag_summary', 'patch-tag_summary.sql' ], [ 'addTable', 'valid_tag', 'patch-valid_tag.sql' ], @@ -287,7 +286,8 @@ class MysqlUpdater extends DatabaseUpdater { // 1.28 [ 'addIndex', 'recentchanges', 'rc_name_type_patrolled_timestamp', 'patch-add-rc_name_type_patrolled_timestamp_index.sql' ], - [ 'doRevisionPageRevIndexNonUnique' ] + [ 'doRevisionPageRevIndexNonUnique' ], + [ 'doNonUniquePlTlIl' ], ]; } @@ -974,24 +974,24 @@ class MysqlUpdater extends DatabaseUpdater { return true; } - protected function doUniquePlTlIl() { + protected function doNonUniquePlTlIl() { $info = $this->db->indexInfo( 'pagelinks', 'pl_namespace' ); - if ( is_array( $info ) && !$info[0]->Non_unique ) { - $this->output( "...pl_namespace, tl_namespace, il_to indices are already UNIQUE.\n" ); + if ( is_array( $info ) && $info[0]->Non_unique ) { + $this->output( "...pl_namespace, tl_namespace, il_to indices are already non-UNIQUE.\n" ); return true; } if ( $this->skipSchema ) { $this->output( "...skipping schema change (making pl_namespace, tl_namespace " . - "and il_to indices UNIQUE).\n" ); + "and il_to indices non-UNIQUE).\n" ); return false; } return $this->applyPatch( - 'patch-pl-tl-il-unique.sql', + 'patch-pl-tl-il-nonunique.sql', false, - 'Making pl_namespace, tl_namespace and il_to indices UNIQUE' + 'Making pl_namespace, tl_namespace and il_to indices non-UNIQUE' ); } diff --git a/maintenance/archives/patch-pl-tl-il-nonunique.sql b/maintenance/archives/patch-pl-tl-il-nonunique.sql new file mode 100644 index 0000000000..8e1715b30e --- /dev/null +++ b/maintenance/archives/patch-pl-tl-il-nonunique.sql @@ -0,0 +1,11 @@ +-- Make reorderings of UNIQUE indices non-UNIQUE +-- Since 1.24, these indices have been non-UNIQUE in tables.sql. +-- However, an earlier update from 1.15 that made the indices +-- UNIQUE was not removed until 1.28 (T78513). + +DROP INDEX /*i*/pl_namespace ON /*_*/pagelinks; +CREATE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace, pl_title, pl_from); +DROP INDEX /*i*/tl_namespace ON /*_*/templatelinks; +CREATE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace, tl_title, tl_from); +DROP INDEX /*i*/il_to ON /*_*/imagelinks; +CREATE INDEX /*i*/il_to ON /*_*/imagelinks (il_to, il_from); diff --git a/maintenance/archives/patch-pl-tl-il-unique.sql b/maintenance/archives/patch-pl-tl-il-unique.sql deleted file mode 100644 index a3566705c5..0000000000 --- a/maintenance/archives/patch-pl-tl-il-unique.sql +++ /dev/null @@ -1,11 +0,0 @@ --- --- patch-pl-tl-il-unique-index.sql --- --- Make reorderings of UNIQUE indices UNIQUE as well - -DROP INDEX /*i*/pl_namespace ON /*_*/pagelinks; -CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace, pl_title, pl_from); -DROP INDEX /*i*/tl_namespace ON /*_*/templatelinks; -CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace, tl_title, tl_from); -DROP INDEX /*i*/il_to ON /*_*/imagelinks; -CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to, il_from);