mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Backport of a 5.0.74 fix into 5.0.72sp1:
BUG#38842 - Fix for 25951 seems incorrect Original changeset: > revision-id: svoj@mysql.com-20081111091051-54pr96nf1z2s30gx > parent: vvaintroub@mysql.com-20081110201804-bi98gcs9avsf58ff > committer: Sergey Vojtovich <svoj@mysql.com> > branch nick: mysql-5.0-bugteam-bug38842 > timestamp: Tue 2008-11-11 13:10:51 +0400
This commit is contained in:
parent
16f374ef65
commit
3b23a99b87
3 changed files with 58 additions and 1 deletions
|
@ -469,3 +469,31 @@ SELECT * FROM t1 WHERE MATCH(a) AGAINST ('"aaaa"' IN BOOLEAN MODE);
|
|||
a
|
||||
aaaaa aaaa
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a VARCHAR(255), b INT, FULLTEXT(a), KEY(b));
|
||||
INSERT INTO t1 VALUES('test', 1),('test', 1),('test', 1),('test', 1),
|
||||
('test', 1),('test', 2),('test', 3),('test', 4);
|
||||
EXPLAIN SELECT * FROM t1
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 fulltext b,a a 0 1 Using where
|
||||
EXPLAIN SELECT * FROM t1 USE INDEX(a)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 fulltext a a 0 1 Using where
|
||||
EXPLAIN SELECT * FROM t1 FORCE INDEX(a)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 fulltext a a 0 1 Using where
|
||||
EXPLAIN SELECT * FROM t1 IGNORE INDEX(a)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref b b 5 const 4 Using where
|
||||
EXPLAIN SELECT * FROM t1 USE INDEX(b)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref b b 5 const 4 Using where
|
||||
EXPLAIN SELECT * FROM t1 FORCE INDEX(b)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref b b 5 const 4 Using where
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -396,3 +396,30 @@ SELECT * FROM t1 WHERE MATCH(a) AGAINST ('"aaaa"' IN BOOLEAN MODE);
|
|||
DROP TABLE t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
# BUG#38842 - Fix for 25951 seems incorrect
|
||||
#
|
||||
CREATE TABLE t1 (a VARCHAR(255), b INT, FULLTEXT(a), KEY(b));
|
||||
INSERT INTO t1 VALUES('test', 1),('test', 1),('test', 1),('test', 1),
|
||||
('test', 1),('test', 2),('test', 3),('test', 4);
|
||||
|
||||
EXPLAIN SELECT * FROM t1
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
|
||||
EXPLAIN SELECT * FROM t1 USE INDEX(a)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
|
||||
EXPLAIN SELECT * FROM t1 FORCE INDEX(a)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
|
||||
EXPLAIN SELECT * FROM t1 IGNORE INDEX(a)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
|
||||
EXPLAIN SELECT * FROM t1 USE INDEX(b)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
|
||||
EXPLAIN SELECT * FROM t1 FORCE INDEX(b)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -5022,7 +5022,9 @@ bool Item_func_match::fix_index()
|
|||
for (keynr=0 ; keynr < table->s->keys ; keynr++)
|
||||
{
|
||||
if ((table->key_info[keynr].flags & HA_FULLTEXT) &&
|
||||
(table->s->keys_in_use.is_set(keynr)))
|
||||
(flags & FT_BOOL ? table->keys_in_use_for_query.is_set(keynr) :
|
||||
table->s->keys_in_use.is_set(keynr)))
|
||||
|
||||
{
|
||||
ft_to_key[fts]=keynr;
|
||||
ft_cnt[fts]=0;
|
||||
|
|
Loading…
Reference in a new issue