diff options
author | unknown <igor@olga.mysql.com> | 2008-01-26 21:45:35 -0800 |
---|---|---|
committer | unknown <igor@olga.mysql.com> | 2008-01-26 21:45:35 -0800 |
commit | e30a0dda8f322aa8714caf6d6de6d583e51809f1 (patch) | |
tree | 94c5ece68aa9b869b84b682bfdbe69161ed61ddc /sql/item.h | |
parent | f80b593d21296245970460d5b95e240a1783afcf (diff) | |
download | mariadb-git-e30a0dda8f322aa8714caf6d6de6d583e51809f1.tar.gz |
Fixed bug #33833.
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.
mysql-test/r/range.result:
Added a test case for bug #33833.
mysql-test/t/range.test:
Added a test case for bug #33833.
sql/item.cc:
Fixed bug #33833.
Added the method eq_by_collation that compares two items almost as
the method Item::eq, but it rather enforces a given collation for
the comparison.
sql/item.h:
Fixed bug #33833.
Added the method eq_by_collation that compares two items almost as
the method Item::eq, but it rather enforces a given collation for
the comparison.
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h index 5f511557f47..f87499f23e3 100644 --- a/sql/item.h +++ b/sql/item.h @@ -873,6 +873,7 @@ public: virtual Field::geometry_type get_geometry_type() const { return Field::GEOM_GEOMETRY; }; String *check_well_formed_result(String *str, bool send_error= 0); + bool eq_by_collation(Item *item, bool binary_cmp, CHARSET_INFO *cs); }; |