diff options
author | unknown <monty@mashka.mysql.fi> | 2002-11-12 13:28:58 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-11-12 13:28:58 +0200 |
commit | 5b53010f85daf777013685aad093c16a0b3670fd (patch) | |
tree | d522520b63bd8dc4ee79e9144e767e6db27b3a8a /sql/sql_select.cc | |
parent | 3559b2f158541ed88ad630dcb0b242f5a32f4a3d (diff) | |
parent | e1c1abd0e189e4581b9a22aed923df37e535e89b (diff) | |
download | mariadb-git-5b53010f85daf777013685aad093c16a0b3670fd.tar.gz |
merge
mysql-test/r/bdb.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
sql/sql_select.cc:
Merge
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index cb2e73c0c26..69dcab61ad7 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -359,6 +359,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds, { conds->fix_fields(thd,tables); conds->change_ref_to_fields(thd,tables); + conds->top_level_item(); having=0; } } @@ -868,6 +869,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds, sort_table_cond))) goto err; table->select_cond=table->select->cond; + table->select_cond->top_level_item(); DBUG_EXECUTE("where",print_where(table->select->cond, "select and having");); having=make_cond_for_table(having,~ (table_map) 0,~used_tables); @@ -5384,6 +5386,7 @@ make_cond_for_table(COND *cond,table_map tables,table_map used_table) { if (((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC) { + /* Create new top level AND item */ Item_cond_and *new_cond=new Item_cond_and; if (!new_cond) return (COND*) 0; // OOM /* purecov: inspected */ @@ -5421,7 +5424,8 @@ make_cond_for_table(COND *cond,table_map tables,table_map used_table) new_cond->argument_list()->push_back(fix); } new_cond->used_tables_cache=((Item_cond_or*) cond)->used_tables_cache; - return new_cond; + new_cond->top_level_item(); + DBUG_RETURN(new_cond); } } @@ -5772,6 +5776,7 @@ static bool fix_having(JOIN *join, Item **having) sort_table_cond))) return 1; table->select_cond=table->select->cond; + table->select_cond->top_level_item(); DBUG_EXECUTE("where",print_where(table->select_cond, "select and having");); *having=make_cond_for_table(*having,~ (table_map) 0,~used_tables); |