Skip to content

Commit 3abfe76

Browse files
committed
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.
1 parent 21175bb commit 3abfe76

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

sql/group_by_handler.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -74,30 +74,6 @@ class group_by_handler
7474
: thd(thd_arg), ht(ht_arg), table(0) {}
7575
virtual ~group_by_handler() {}
7676

77-
/*
78-
Store pointer to temporary table and objects modified to point to
79-
the temporary table. This will happen during the optimize phase.
80-
81-
We provide new 'having' and 'order_by' elements here. The differ from the
82-
original ones in that these are modified to point to fields in the
83-
temporary table 'table'.
84-
85-
Return 1 if the storage handler cannot handle the GROUP BY after all,
86-
in which case we have to give an error to the end user for the query.
87-
This is becasue we can't revert back the old having and order_by elements.
88-
*/
89-
90-
virtual bool init(Item *having_arg, ORDER *order_by_arg)
91-
{
92-
return 0;
93-
}
94-
95-
bool ha_init(TABLE *temporary_table, Item *having_arg, ORDER *order_by_arg)
96-
{
97-
table= temporary_table;
98-
return init(having_arg, order_by_arg);
99-
}
100-
10177
/*
10278
Functions to scan data. All these returns 0 if ok, error code in case
10379
of error

sql/sql_select.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,6 @@ JOIN::optimize_inner()
19221922
if (gbh)
19231923
{
19241924
pushdown_query= new (thd->mem_root) Pushdown_query(select_lex, gbh);
1925-
int err;
19261925

19271926
/*
19281927
We must store rows in the tmp table if we need to do an ORDER BY
@@ -1953,11 +1952,8 @@ JOIN::optimize_inner()
19531952
DBUG_RETURN(1);
19541953

19551954
/* Give storage engine access to temporary table */
1956-
if ((err= gbh->ha_init(exec_tmp_table1, having, order)))
1957-
{
1958-
gbh->print_error(err, MYF(0));
1959-
DBUG_RETURN(1);
1960-
}
1955+
gbh->table= exec_tmp_table1;
1956+
19611957
pushdown_query->store_data_in_temp_table= need_tmp;
19621958
pushdown_query->having= having;
19631959
/*

0 commit comments

Comments
 (0)