Paladox has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/291591

Change subject: Test
......................................................................

Test

Change-Id: Iccbd4bfb42a572249846c649f41be0170e6dc399
---
M includes/installer/MysqlUpdater.php
A maintenance/archives/patch-mysql-5.6-searchindex.sql
2 files changed, 34 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/91/291591/1

diff --git a/includes/installer/MysqlUpdater.php 
b/includes/installer/MysqlUpdater.php
index d414d907..07e717e 100644
--- a/includes/installer/MysqlUpdater.php
+++ b/includes/installer/MysqlUpdater.php
@@ -29,6 +29,17 @@
  */
 class MysqlUpdater extends DatabaseUpdater {
        protected function getCoreUpdateList() {
+               $status = $this->getConnection();
+               $conn = $status->value;
+               $version = $conn->getServerVersion();
+
+               if ( version_compare( $version, '5.6' ) < 0 ) {
+                       $SearchIndexDrop = [ 'dropTable', 'searchindex' ];
+                       $SearchIndexAddTable = [ 'addTable', 'searchindex', 
'patch-mysql-5.6-searchindex.sql' ];
+               } else {
+                       $SearchIndexDrop = [ '' ];
+                       $SearchIndexAddTable = [ '' ];
+               }
                return [
                        [ 'disableContentHandlerUseDB' ],
 
@@ -283,6 +294,8 @@
                        [ 'addIndex', 'categorylinks', 'cl_collation_ext',
                                'patch-add-cl_collation_ext_index.sql' ],
                        [ 'doCollationUpdate' ],
+                       $SearchIndexDrop,
+                       $SearchIndexAddTable,
                ];
        }
 
diff --git a/maintenance/archives/patch-mysql-5.6-searchindex.sql 
b/maintenance/archives/patch-mysql-5.6-searchindex.sql
new file mode 100644
index 0000000..30e7bca
--- /dev/null
+++ b/maintenance/archives/patch-mysql-5.6-searchindex.sql
@@ -0,0 +1,21 @@
+-- This only supports mysql 5.6+
+--
+-- When using the default MySQL search backend, page titles
+-- and text are munged to strip markup, do Unicode case folding,
+-- and prepare the result for MySQL's fulltext index.
+--
+-- This table must be InnoDB;
+--
+CREATE TABLE /*_*/searchindex (
+  -- Key to page_id
+  si_page int unsigned NOT NULL,
+
+  -- Munged version of title
+  si_title varchar(255) NOT NULL default '',
+
+  -- Munged version of body text
+  si_text mediumtext NOT NULL,
+  FULLTEXT KEY si_title (si_title, si_text)
+) /*$wgDBTableOptions*/;
+
+CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page);

-- 
To view, visit https://gerrit.wikimedia.org/r/291591
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iccbd4bfb42a572249846c649f41be0170e6dc399
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to