diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2009-01-28 22:48:41 +0400 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2009-01-28 22:48:41 +0400 |
commit | b135bcabe50fecd1999023752351dedee832bf0f (patch) | |
tree | b8702fe7843344105f23871d8949d50349166d12 /sql/sql_select.cc | |
parent | a931ac090dd64bfac6b061b92fbd36d108aff62b (diff) | |
parent | 334e249f914359864996adaf54508ed7b40971e2 (diff) | |
download | mariadb-git-b135bcabe50fecd1999023752351dedee832bf0f.tar.gz |
automerge 5.0-bugteam --> 5.1-bugteam (bug 39069)
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 49cacbe9272..90a5c5c4c8b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1676,8 +1676,13 @@ JOIN::exec() We have to test for 'conds' here as the WHERE may not be constant even if we don't have any tables for prepared statements or if conds uses something like 'rand()'. + If the HAVING clause is either impossible or always true, then + JOIN::having is set to NULL by optimize_cond. + In this case JOIN::exec must check for JOIN::having_value, in the + same way it checks for JOIN::cond_value. */ if (cond_value != Item::COND_FALSE && + having_value != Item::COND_FALSE && (!conds || conds->val_int()) && (!having || having->val_int())) { |