From 9182079c5ff5081f6889a765e16a102610a77863 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 25 Apr 2011 17:22:25 +0200 Subject: lots of post-merge changes --- sql/item_sum.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sql/item_sum.cc') diff --git a/sql/item_sum.cc b/sql/item_sum.cc index a9c77e2fea5..4a7f2a54659 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -539,6 +539,11 @@ void Item_sum::update_used_tables () args[i]->update_used_tables(); used_tables_cache|= args[i]->used_tables(); } + + used_tables_cache&= PSEUDO_TABLE_BITS; + + /* the aggregate function is aggregated into its local context */ + used_tables_cache |= (1 << aggr_sel->join->tables) - 1; } } @@ -762,7 +767,7 @@ bool Aggregator_distinct::setup(THD *thd) if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1, 0, (select_lex->options | thd->variables.option_bits), - HA_POS_ERROR, ""))) + HA_POS_ERROR, const_cast("")))) return TRUE; table->file->extra(HA_EXTRA_NO_ROWS); // Don't update rows table->no_rows=1; -- cgit v1.2.1