Commit 8acc7fb3 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-24088 Assertion in InnoDB's FTS code may be triggered by a repeated words...

MDEV-24088 Assertion in InnoDB's FTS code may be triggered by a repeated words fed to simple_parser plugin

increment `position` for every word, because the plugin doesn't
(FTS API doesn't use positions that InnoDB FTS relies on)
parent 2c16fd9b
......@@ -161,6 +161,7 @@ id title body
SELECT COUNT(*) FROM articles;
COUNT(*)
5
INSERT INTO articles (title, body) VALUES ('111', '1234 1234 1234');
DROP TABLE articles;
# Test Part 5: Test Uninstall Plugin After Index is Built
CREATE TABLE articles (
......
......@@ -158,6 +158,8 @@ SELECT * FROM articles WHERE
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full text search');
SELECT COUNT(*) FROM articles;
INSERT INTO articles (title, body) VALUES ('111', '1234 1234 1234');
DROP TABLE articles;
-- echo # Test Part 5: Test Uninstall Plugin After Index is Built
......
......@@ -4691,7 +4691,7 @@ fts_tokenize_add_word_for_parser(
ut_ad(boolean_info->position >= 0);
position = boolean_info->position + fts_param->add_pos;
*/
position = fts_param->add_pos;
position = fts_param->add_pos++;
fts_add_token(result_doc, str, position);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment