summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2022-01-18 15:32:01 +0400
committerAlexander Barkov <bar@mariadb.com>2022-01-18 15:32:01 +0400
commitbf9bc991066df78a37e917127d61d044700c3950 (patch)
treec09d5af89e588fa64aeb9c83f7ae4e1affef6fc9 /sql/field.cc
parent47e18af906f41c3b15796b8d4e6da9b744491b91 (diff)
downloadmariadb-git-bf9bc991066df78a37e917127d61d044700c3950.tar.gz
MDEV-26129 Bad results with join comparing case insensitive VARCHAR/ENUM/SET expression to a _bin ENUM columnbb-10.2-MDEV-26129
Range optimizer incorrectly was used for ENUM columns when the operation collation did not match the column collation. Adding a virtual implementation of Field_enum::can_optimize_range() which tests if the column and the operation collation match.
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 4e6bc6b8341..74317a4d70b 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -9484,8 +9484,8 @@ uint Field_num::is_equal(Create_field *new_field)
}
-bool Field_enum::can_optimize_keypart_ref(const Item_bool_func *cond,
- const Item *item) const
+bool Field_enum::can_optimize_range_or_keypart_ref(const Item_bool_func *cond,
+ const Item *item) const
{
DBUG_ASSERT(cmp_type() == INT_RESULT);
DBUG_ASSERT(result_type() == STRING_RESULT);