1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00
Two disjuncts containing equalities of the form key=const1 and key=const2 can
be merged into one if const1 is equal to const2. To check it the common 
collation of the constants were used rather than the collation of the field key.
For example when the default collation of the constants was cases insensitive
while the collation of the field was case sensitive, then two or-ed equality 
predicates key='b' and key='B' incorrectly were merged into one f='b'. As a 
result ref access was used instead of range access and wrong result sets were 
returned in many cases. 
Fixed the problem by comparing constant in the or-ed predicate with collation of
the key field.
This commit is contained in:
igor@olga.mysql.com
2008-01-26 21:45:35 -08:00
parent 6619db580d
commit 5e14047e23
5 changed files with 77 additions and 1 deletions

View File

@ -2887,7 +2887,9 @@ merge_key_fields(KEY_FIELD *start,KEY_FIELD *new_fields,KEY_FIELD *end,
}
}
else if (old->eq_func && new_fields->eq_func &&
old->val->eq(new_fields->val, old->field->binary()))
old->val->eq_by_collation(new_fields->val,
old->field->binary(),
old->field->charset()))
{
old->level= and_level;