summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-10-03 08:22:17 +0200
committerSergei Golubchik <serg@mariadb.org>2015-10-05 17:14:16 +0200
commit3abfe76e2d80934c62f04cebdf94a053d393287f (patch)
tree292f78f319689eac6fdce7acab2192fddd17e3e8
parent21175bb31610cdfe7f25b981edc760e46aa08c43 (diff)
downloadmariadb-git-3abfe76e2d80934c62f04cebdf94a053d393287f.tar.gz
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.
-rw-r--r--sql/group_by_handler.h24
-rw-r--r--sql/sql_select.cc8
2 files changed, 2 insertions, 30 deletions
diff --git a/sql/group_by_handler.h b/sql/group_by_handler.h
index 993e94819a2..b05b7fd39ae 100644
--- a/sql/group_by_handler.h
+++ b/sql/group_by_handler.h
@@ -75,30 +75,6 @@ public:
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
*/
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index af8571fb714..d1912ac3e46 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -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;
/*