MDEV-6978 Bad results with join comparing case insensitive VARCHAR/ENUM/SET

expression to a _bin ENUM column
This commit is contained in:
Alexander Barkov 2014-11-19 10:33:49 +04:00
commit 55dd89e919
6 changed files with 277 additions and 1 deletions

View file

@ -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;
}