mariadb/storage
Sachin Agarwal 1ff8588c3f Bug #31228694 FTS QUERY WITH LIMIT HIT AN ASSERT
Problem:
1. The server terminates abnormally when phrase search doesn't
filter out doc_ids correctly. This problem has been fixed in bug
2. Wrong query result: It's a regression from the bug #22709692 fix.
This fix optimize full-text search query with limit clause.
when FTS expression involves only union operation, we fetch only
number of doc_ids specified with the limit clause.
Fulltext phrase search is not an union operation and we consider
phrase search with plugin parser a union operation.
In phrase search with limit clause, we fetch limited doc_ids for
each token and if any of the selected doc_id does not contain all
tokens in correct order then we do not include that row_id in the
result set.
Therefore phrase search gets fewer number of rows than the qualified
rows exist in the table.

Fix:
Added a condition that phrase search with plugin parser is not a
union operation.

RB: 24925
Reviewed by : Annamalai Gurusami <annamalai.gurusami@oracle.com>

This is a cherry-pick of
mysql/mysql-server@5549920b7a
without a test case, because the test case depends on an n-gram
tokenizer that will be missing from MariaDB until MDEV-10267 is added.
2020-10-26 13:32:30 +02:00
..
archive
blackhole
cassandra
connect Merge remote-tracking branch 'connect/10.2' into 10.2 2020-10-26 09:08:44 +01:00
csv
example
federated
federatedx
heap
innobase Bug #31228694 FTS QUERY WITH LIMIT HIT AN ASSERT 2020-10-26 13:32:30 +02:00
maria Merge 10.1 into 10.2 2020-09-01 16:20:23 +03:00
mroonga Merge 10.1 into 10.2 2020-06-01 09:33:03 +03:00
myisam Merge 10.1 into 10.2 2020-09-01 16:20:23 +03:00
myisammrg Merge branch '10.1' into 10.2 2020-08-02 11:05:29 +02:00
oqgraph
perfschema
rocksdb Fix a typo in the previous cset 2020-09-04 09:12:27 +00:00
sequence
sphinx
spider MDEV-7098 spider/bg.spider_fixes failed in buildbot with safe_mutex: Trying to unlock mutex conn->mta_conn_mutex that wasn't locked at storage/spider/spd_db_conn.cc, line 671 2020-09-07 10:26:23 +09:00
test_sql_discovery
tokudb Merge branch '10.1' into 10.2 2020-08-06 16:47:39 +02:00
xtradb Merge 10.1 into 10.2 2020-10-21 14:02:04 +03:00