From 13dc299a4fa50627aff42480c8e995347283e475 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 16 Apr 2014 22:34:52 -0700 Subject: Fixed bugs mdev-5927 and mdev-6116. Both bugs are caused by the same problem: the function optimize_cond() should update the value of *cond_equal rather than the value of join->cond_equal, because it is called not only for the WHERE condition, but for the HAVING condition as well. --- sql/sql_select.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 15bd6886682..45fa64e5a64 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -13234,7 +13234,7 @@ optimize_cond(JOIN *join, COND *conds, conds= remove_eq_conds(thd, conds, cond_value); if (conds && conds->type() == Item::COND_ITEM && ((Item_cond*) conds)->functype() == Item_func::COND_AND_FUNC) - join->cond_equal= &((Item_cond_and*) conds)->cond_equal; + *cond_equal= &((Item_cond_and*) conds)->cond_equal; DBUG_EXECUTE("info",print_where(conds,"after remove", QT_ORDINARY);); } DBUG_RETURN(conds); -- cgit v1.2.1