summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2006-01-31 21:48:32 -0800
committerigor@rurik.mysql.com <>2006-01-31 21:48:32 -0800
commitd6370b48a7761b7e8716c92267458561dc77124c (patch)
tree8bf7ac2e42e3520d4fd076d65f554cba3db5c654 /sql/sql_lex.cc
parent7e5108392d72aa755174da8f56dc42ccd1b82ee6 (diff)
downloadmariadb-git-d6370b48a7761b7e8716c92267458561dc77124c.tar.gz
FIxed bug #14927.
A query with a group by and having clauses could return a wrong result set if the having condition contained a constant conjunct evaluated to FALSE. It happened because the pushdown condition for table with grouping columns lost its constant conjuncts. Pushdown conditions are always built by the function make_cond_for_table that ignores constant conjuncts. This is apparently not correct when constant false conjuncts are present.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 16641ad6dd5..7348816ea27 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1074,6 +1074,7 @@ void st_select_lex::init_query()
item_list.empty();
join= 0;
where= 0;
+ having= 0;
olap= UNSPECIFIED_OLAP_TYPE;
having_fix_field= 0;
resolve_mode= NOMATTER_MODE;
@@ -1081,6 +1082,7 @@ void st_select_lex::init_query()
ref_pointer_array= 0;
select_n_having_items= 0;
prep_where= 0;
+ prep_having= 0;
subquery_in_having= explicit_limit= 0;
parsing_place= NO_MATTER;
is_item_list_lookup= 0;