diff options
author | Igor Babaev <igor@askmonty.org> | 2014-04-16 22:34:52 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2014-04-16 22:34:52 -0700 |
commit | 13dc299a4fa50627aff42480c8e995347283e475 (patch) | |
tree | f8be0aea816ecb20e40d3602ac7500d32a37579f /sql | |
parent | 65f80d4052e48accab9b152d7368b7aa0ccc3c80 (diff) | |
download | mariadb-git-13dc299a4fa50627aff42480c8e995347283e475.tar.gz |
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.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_select.cc | 2 |
1 files changed, 1 insertions, 1 deletions
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); |