Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.0, 13.1, 13.2
-
None
Description
Likely cause: commit 2f09b28e0f7f8e4291003a9b46c62b54f3bf4454 (MDEV-7705), which added full-text search to partitioned tables in CS 10.3.3. Before that change, a partitioned table could not have a FULLTEXT index.
--source include/have_partition.inc
|
CREATE TABLE t1 (a INT, t TEXT, FULLTEXT (t)) ENGINE=MyISAM PARTITION BY HASH (a) PARTITIONS 2; |
INSERT INTO t1 VALUES (1, 'apple banana'), (2, 'cherry grape'), (3, 'melon lemon'), (4, 'peach plum'); |
--let $n= `SELECT COUNT(*) FROM t1 WHERE MATCH (t) AGAINST ('apple')`
|
if (!$n) |
{
|
--die A natural language full-text search on a partitioned MyISAM table does not find a word that is in 1 of 4 rows |
}
|
CREATE TABLE t2 (a INT, t TEXT, FULLTEXT (t)) ENGINE=Aria PARTITION BY HASH (a) PARTITIONS 2; |
INSERT INTO t2 SELECT * FROM t1; |
--let $n= `SELECT COUNT(*) FROM t2 WHERE MATCH (t) AGAINST ('apple')`
|
if (!$n) |
{
|
--die A natural language full-text search on a partitioned Aria table does not find a word that is in 1 of 4 rows |
}
|
DROP TABLE t1, t2; |
Leads to:
|
CS 13.1.2 87e62ca17270e163a6d41b3fc8d6f4d440f1bb88 (Optimized, Clang 22.1.8-20260622) Build 05/10/2026 |
mysqltest: At line 7: A natural language full-text search on a partitioned MyISAM table does not find a word that is in 1 of 4 rows
|
Partitioning changes the query result. Without partitioning, the same search finds the row. The 50% threshold is applied to each partition on its own: 'apple' is in 1 of the 2 rows of its partition, so it is ignored. The relevance values also differ from the table without partitioning. Boolean mode is not affected. Aria and debug builds give the same result.
From the code it seems that ha_partition::ft_init_ext() calls ft_init_ext() of each partition on its own, and the weight (GWS_PROB in storage/myisam/ftdefs.h, the same in Aria) uses the record count of that partition. The relevance values of different partitions are then also on different scales.
Attachments
Issue Links
- is caused by
-
MDEV-7705 Spiral patch 007_mariadb-10.0.15.partition_fulltext.diff
-
- Closed
-