summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-10-20 08:29:56 +0530
committerMarko Mäkelä <marko.makela@mariadb.com>2022-10-21 09:54:46 +0300
commite1414fc7e38e561dba74ed8bf694828d1277b714 (patch)
treeac9e0c1ab37d2abccd845e9e303c68b0ac9b939b /storage
parente11661a4a2c0d50d78b86dac71a0e3d226f0ddcf (diff)
downloadmariadb-git-e1414fc7e38e561dba74ed8bf694828d1277b714.tar.gz
MDEV-29778 Having Unique index interference with MATCH from a FULLTEXT
InnoDB fails to fetch FTS_DOC_ID if the select query uses secondary index. So always do extra lookup on clustered index in case of fts query
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 0fe60ccabe6..cd2d36df112 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -7703,6 +7703,11 @@ ha_innobase::build_template(
m_prebuilt->versioned_write = table->versioned_write(VERS_TRX_ID);
m_prebuilt->need_to_access_clustered = (index == clust_index);
+ if (m_prebuilt->in_fts_query) {
+ /* Do clustered index lookup to fetch the FTS_DOC_ID */
+ m_prebuilt->need_to_access_clustered = true;
+ }
+
/* Either m_prebuilt->index should be a secondary index, or it
should be the clustered index. */
ut_ad(dict_index_is_clust(index) == (index == clust_index));