summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2006-05-06 23:48:13 -0700
committerigor@rurik.mysql.com <>2006-05-06 23:48:13 -0700
commit7977a0c86734dd2912c89433048b563232bc5942 (patch)
treec0395e36606a03a1a826b85cd00bc0c1484e9314 /sql/sql_lex.cc
parentceef1105b258fe23745ca5d04ad60951ad21bd8b (diff)
downloadmariadb-git-7977a0c86734dd2912c89433048b563232bc5942.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;