summaryrefslogtreecommitdiff
path: root/sql/opt_table_elimination.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-03-13 15:48:39 +0400
committerAlexander Barkov <bar@mariadb.org>2015-03-13 15:48:39 +0400
commit75d65b5f4e5428310e57155903602801d7d86ee2 (patch)
tree5f040d221a3290008eb0cf5155b79b29d579bfb1 /sql/opt_table_elimination.cc
parentbd2105855ac03cb3d4705342b01a3361a45a5f7c (diff)
downloadmariadb-git-75d65b5f4e5428310e57155903602801d7d86ee2.tar.gz
MDEV-6989 BINARY and COLLATE xxx_bin comparisions are not used for optimization in some cases
Diffstat (limited to 'sql/opt_table_elimination.cc')
-rw-r--r--sql/opt_table_elimination.cc22
1 files changed, 1 insertions, 21 deletions
diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc
index 6434c36aaf2..f6e3b619f51 100644
--- a/sql/opt_table_elimination.cc
+++ b/sql/opt_table_elimination.cc
@@ -1486,28 +1486,8 @@ void check_equality(Dep_analysis_context *ctx, Dep_module_expr **eq_mod,
left->real_item()->type() == Item::FIELD_ITEM)
{
Field *field= ((Item_field*)left->real_item())->field;
- if (right->cmp_type() == TIME_RESULT && field->cmp_type() != TIME_RESULT)
+ if (!field->can_optimize_outer_join_table_elimination(cond, right))
return;
- if (field->result_type() == STRING_RESULT)
- {
- if (right->result_type() != STRING_RESULT)
- {
- if (field->cmp_type() != right->result_type())
- return;
- }
- else
- {
- /*
- 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 ||
- field->real_type() == MYSQL_TYPE_ENUM ||
- field->real_type() == MYSQL_TYPE_SET) &&
- field->charset() != cond->compare_collation())
- return;
- }
- }
Dep_value_field *field_val;
if ((field_val= ctx->get_field_value(field)))
add_module_expr(ctx, eq_mod, and_level, field_val, right, NULL);