From 72e5980182d4db991381ae7a483e543150fdb355 Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Tue, 10 Oct 2017 09:51:39 -0700 Subject: [PATCH] Split sql fulltext index creation into two statements MySQL prior to 5.6.8 (https://bugs.mysql.com/bug.php?id=67004) did not support adding multiple fulltext indices at the same time on InnoDB. Split them into two statements to work around this limitation. Bug: T177477 Change-Id: Ib366fa04724abac6d740bea017274ad62730b9e5 --- maintenance/rebuildtextindex.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php index faa4d96293..c786925440 100644 --- a/maintenance/rebuildtextindex.php +++ b/maintenance/rebuildtextindex.php @@ -145,9 +145,10 @@ class RebuildTextIndex extends Maintenance { private function createMysqlTextIndex() { $searchindex = $this->db->tableName( 'searchindex' ); $this->output( "\nRebuild the index...\n" ); - $sql = "ALTER TABLE $searchindex ADD FULLTEXT si_title (si_title), " . - "ADD FULLTEXT si_text (si_text)"; - $this->db->query( $sql, __METHOD__ ); + foreach ( [ 'si_title', 'si_text' ] as $field ) { + $sql = "ALTER TABLE $searchindex ADD FULLTEXT $field ($field)"; + $this->db->query( $sql, __METHOD__ ); + } } /** -- 2.20.1