remove unused group_by_handler::init() method
The assumption is that the engine should not need to evaluate HAVING on the table->record[0] - the engine either can evaluate HAVING internally before writing it to the table->record[0], or it should leave it to the server, that will evaluate HAVING(table->record[0]). Similarly the engine should not need to evaluate ORDER on the table->record[0]. Either it returns the data already sorted, or the server will sort the table.
This commit is contained in:
parent
21175bb316
commit
3abfe76e2d
@ -74,30 +74,6 @@ public:
|
||||
: thd(thd_arg), ht(ht_arg), table(0) {}
|
||||
virtual ~group_by_handler() {}
|
||||
|
||||
/*
|
||||
Store pointer to temporary table and objects modified to point to
|
||||
the temporary table. This will happen during the optimize phase.
|
||||
|
||||
We provide new 'having' and 'order_by' elements here. The differ from the
|
||||
original ones in that these are modified to point to fields in the
|
||||
temporary table 'table'.
|
||||
|
||||
Return 1 if the storage handler cannot handle the GROUP BY after all,
|
||||
in which case we have to give an error to the end user for the query.
|
||||
This is becasue we can't revert back the old having and order_by elements.
|
||||
*/
|
||||
|
||||
virtual bool init(Item *having_arg, ORDER *order_by_arg)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ha_init(TABLE *temporary_table, Item *having_arg, ORDER *order_by_arg)
|
||||
{
|
||||
table= temporary_table;
|
||||
return init(having_arg, order_by_arg);
|
||||
}
|
||||
|
||||
/*
|
||||
Functions to scan data. All these returns 0 if ok, error code in case
|
||||
of error
|
||||
|
@ -1922,7 +1922,6 @@ JOIN::optimize_inner()
|
||||
if (gbh)
|
||||
{
|
||||
pushdown_query= new (thd->mem_root) Pushdown_query(select_lex, gbh);
|
||||
int err;
|
||||
|
||||
/*
|
||||
We must store rows in the tmp table if we need to do an ORDER BY
|
||||
@ -1953,11 +1952,8 @@ JOIN::optimize_inner()
|
||||
DBUG_RETURN(1);
|
||||
|
||||
/* Give storage engine access to temporary table */
|
||||
if ((err= gbh->ha_init(exec_tmp_table1, having, order)))
|
||||
{
|
||||
gbh->print_error(err, MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
gbh->table= exec_tmp_table1;
|
||||
|
||||
pushdown_query->store_data_in_temp_table= need_tmp;
|
||||
pushdown_query->having= having;
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user