diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-10-02 10:19:40 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-10-05 17:14:15 +0200 |
commit | 7ca8b4bbfa3fc1ac12bbfc20530426fa534b9142 (patch) | |
tree | 9cc3720ca103f46bb84da6b2f77339a9a404e7c5 /sql/group_by_handler.cc | |
parent | 9ca3d9ea9cc3518706dc8e0e0ac89a58c34dc260 (diff) | |
download | mariadb-git-7ca8b4bbfa3fc1ac12bbfc20530426fa534b9142.tar.gz |
move internal API out from group_by_handler
into a Pushdown_query object
Diffstat (limited to 'sql/group_by_handler.cc')
-rw-r--r-- | sql/group_by_handler.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sql/group_by_handler.cc b/sql/group_by_handler.cc index ba798967d34..ce73b1c3512 100644 --- a/sql/group_by_handler.cc +++ b/sql/group_by_handler.cc @@ -35,15 +35,17 @@ -1 if error should be sent */ -int group_by_handler::execute(JOIN *join) +int Pushdown_query::execute(JOIN *join) { int err; ha_rows max_limit; ha_rows *reset_limit= 0; Item **reset_item= 0; - DBUG_ENTER("group_by_handler::execute"); + THD *thd= handler->thd; + TABLE *table= handler->table; + DBUG_ENTER("Pushdown_query::execute"); - if ((err= init_scan())) + if ((err= handler->init_scan())) goto error; if (store_data_in_temp_table) @@ -58,17 +60,17 @@ int group_by_handler::execute(JOIN *join) reset_item= &join->unit->fake_select_lex->select_limit; } - while (!(err= next_row())) + while (!(err= handler->next_row())) { if (thd->check_killed()) { thd->send_kill_message(); - (void) end_scan(); + handler->end_scan(); DBUG_RETURN(-1); } /* Check if we can accept the row */ - if (!having || having->val_bool()) + if (!handler->having || handler->having->val_bool()) { if (store_data_in_temp_table) { @@ -97,7 +99,7 @@ int group_by_handler::execute(JOIN *join) /* result < 0 if row was not accepted and should not be counted */ if ((error= join->result->send_data(*join->fields))) { - (void) end_scan(); + handler->end_scan(); DBUG_RETURN(error < 0 ? 0 : -1); } } @@ -119,7 +121,7 @@ int group_by_handler::execute(JOIN *join) if (err != 0 && err != HA_ERR_END_OF_FILE) goto error; - if ((err= end_scan())) + if ((err= handler->end_scan())) goto error_2; if (!store_data_in_temp_table && join->result->send_eof()) DBUG_RETURN(1); // Don't send error to client @@ -127,9 +129,9 @@ int group_by_handler::execute(JOIN *join) DBUG_RETURN(0); error: - (void) end_scan(); + handler->end_scan(); error_2: - print_error(err, MYF(0)); + handler->print_error(err, MYF(0)); DBUG_RETURN(-1); // Error not sent to client } |