1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed bug #25971: indexes on text columns were ignored when ref accesses

were evaluated.
According to the new rules for string comparison partial indexes on text
columns can be used in the same cases when partial indexes on varchar
columns can be used.
This commit is contained in:
igor@olga.mysql.com
2007-02-14 22:06:41 -08:00
parent c84ee7079c
commit a2d4a042d0
7 changed files with 200 additions and 12 deletions

View File

@ -2854,15 +2854,9 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond,
/*
We can't use indexes if the effective collation
of the operation differ from the field collation.
We also cannot use index on a text column, as the column may
contain 'x' 'x\t' 'x ' and 'read_next_same' will stop after
'x' when searching for WHERE col='x '
*/
if (field->cmp_type() == STRING_RESULT &&
(((Field_str*)field)->charset() != cond->compare_collation() ||
((*value)->type() != Item::NULL_ITEM &&
(field->flags & BLOB_FLAG) && !field->binary())))
((Field_str*)field)->charset() != cond->compare_collation())
return;
}
}