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
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__ );
+ }
}
/**