aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasey Peel <cpeel@users.noreply.github.com>2019-07-08 05:46:41 +0000
committerCasey Peel <cpeel@users.noreply.github.com>2019-07-08 05:58:41 +0000
commite33e5727413543c74b3ede43ad437bb261c72839 (patch)
tree011e912d9461ab03ca873e0e7d8d6fc40c6d556d
parent9e9bdb69b5e00a4993b7ff9a6021044c9ec0c4dc (diff)
downloadforums-e33e5727413543c74b3ede43ad437bb261c72839.tar
forums-e33e5727413543c74b3ede43ad437bb261c72839.tar.gz
forums-e33e5727413543c74b3ede43ad437bb261c72839.tar.bz2
forums-e33e5727413543c74b3ede43ad437bb261c72839.tar.xz
forums-e33e5727413543c74b3ede43ad437bb261c72839.zip
[ticket/16096] Use InnoDB fulltext limits for InnoDB tables
The max and min search length for the MySQL database vary based on the engine for the underlying table. For MyISAM tables, the variables are ft_max_word_len and ft_min_word_len, but for InnoDB tables the variables are innodb_ft_max_token_size and innodb_ft_min_token_size. Take the posts table type into account when setting the max and min search length. PHPBB3-16096
-rw-r--r--phpBB/phpbb/search/fulltext_mysql.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php
index 137ed7433d..1105d0892f 100644
--- a/phpBB/phpbb/search/fulltext_mysql.php
+++ b/phpBB/phpbb/search/fulltext_mysql.php
@@ -188,7 +188,7 @@ class fulltext_mysql extends \phpbb\search\base
}
$sql = 'SHOW VARIABLES
- LIKE \'ft\_%\'';
+ LIKE \'%ft\_%\'';
$result = $this->db->sql_query($sql);
$mysql_info = array();
@@ -198,8 +198,16 @@ class fulltext_mysql extends \phpbb\search\base
}
$this->db->sql_freeresult($result);
- $this->config->set('fulltext_mysql_max_word_len', $mysql_info['ft_max_word_len']);
- $this->config->set('fulltext_mysql_min_word_len', $mysql_info['ft_min_word_len']);
+ if ($engine === 'MyISAM')
+ {
+ $this->config->set('fulltext_mysql_max_word_len', $mysql_info['ft_max_word_len']);
+ $this->config->set('fulltext_mysql_min_word_len', $mysql_info['ft_min_word_len']);
+ }
+ else if ($engine === 'InnoDB')
+ {
+ $this->config->set('fulltext_mysql_max_word_len', $mysql_info['innodb_ft_max_token_size']);
+ $this->config->set('fulltext_mysql_min_word_len', $mysql_info['innodb_ft_min_token_size']);
+ }
return false;
}