Followup r79702, r66793, r66822
authorSam Reed <reedy@users.mediawiki.org>
Thu, 6 Jan 2011 19:27:17 +0000 (19:27 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 6 Jan 2011 19:27:17 +0000 (19:27 +0000)
Add patch to kill bad original ar_page_revid index (did exist as 2 definitions under the same name). Add patch to add index ar_revid per FIXME, though, hopefully only a temporary index

Updated tables.sql with new index

includes/installer/MysqlUpdater.php
maintenance/archives/patch-archive_ar_revid.sql [new file with mode: 0644]
maintenance/archives/patch-archive_kill_ar_page_revid.sql [new file with mode: 0644]
maintenance/tables.sql

index 12c14f6..cceef11 100644 (file)
@@ -171,6 +171,8 @@ class MysqlUpdater extends DatabaseUpdater {
                        array( 'doCollationUpdate' ),
                        array( 'addTable', 'msg_resource',                      'patch-msg_resource.sql' ),
                        array( 'addTable', 'module_deps',                       'patch-module_deps.sql' ),
+                       array( 'dropIndex', 'archive', 'ar_page_revid',         'patch-archive_kill_ar_page_revid.sql' ),
+               array( 'addIndex', 'archive', 'ar_revid',               'patch-archive_ar_revid.sql' ),
                );
        }
 
diff --git a/maintenance/archives/patch-archive_ar_revid.sql b/maintenance/archives/patch-archive_ar_revid.sql
new file mode 100644 (file)
index 0000000..67ee97b
--- /dev/null
@@ -0,0 +1,4 @@
+-- Hopefully temporary index.
+-- For https://bugzilla.wikimedia.org/show_bug.cgi?id=21279
+ALTER TABLE /*$wgDBprefix*/archive
+       ADD INDEX ar_revid ( ar_rev_id );
\ No newline at end of file
diff --git a/maintenance/archives/patch-archive_kill_ar_page_revid.sql b/maintenance/archives/patch-archive_kill_ar_page_revid.sql
new file mode 100644 (file)
index 0000000..2e6fe45
--- /dev/null
@@ -0,0 +1,4 @@
+-- Used for killing the wrong index added during SVN for 1.17
+-- Won't affect most people, but it doesn't need to exist
+ALTER TABLE /*$wgDBprefix*/archive
+       DROP INDEX ar_page_revid;
\ No newline at end of file
index 7a3f1ea..f9c5cd6 100644 (file)
@@ -419,7 +419,7 @@ CREATE TABLE /*_*/archive (
 
 CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp);
 CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp);
-CREATE INDEX /*i*/ar_page_revid ON /*_*/archive (ar_rev_id);
+CREATE INDEX /*i*/ar_revid ON /*_*/archive (ar_rev_id);
 
 
 --