summaryrefslogtreecommitdiff
path: root/sql/opt_table_elimination.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2014-11-19 10:33:49 +0400
committerAlexander Barkov <bar@mnogosearch.org>2014-11-19 10:33:49 +0400
commit55dd89e9195a36dd977e4485becc701135adddb8 (patch)
tree2714208343a8fc30bf459e9a4b58b92b8d808cf0 /sql/opt_table_elimination.cc
parentb52d4d0076a7fbd2f4cb4d226947b708077ed8a6 (diff)
downloadmariadb-git-55dd89e9195a36dd977e4485becc701135adddb8.tar.gz
MDEV-6978 Bad results with join comparing case insensitive VARCHAR/ENUM/SET
expression to a _bin ENUM column
Diffstat (limited to 'sql/opt_table_elimination.cc')
-rw-r--r--sql/opt_table_elimination.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc
index 9c10790f9c0..6434c36aaf2 100644
--- a/sql/opt_table_elimination.cc
+++ b/sql/opt_table_elimination.cc
@@ -1501,7 +1501,9 @@ void check_equality(Dep_analysis_context *ctx, Dep_module_expr **eq_mod,
We can't assume there's a functional dependency if the effective
collation of the operation differ from the field collation.
*/
- if (field->cmp_type() == STRING_RESULT &&
+ if ((field->cmp_type() == STRING_RESULT ||
+ field->real_type() == MYSQL_TYPE_ENUM ||
+ field->real_type() == MYSQL_TYPE_SET) &&
field->charset() != cond->compare_collation())
return;
}