From 21175bb31610cdfe7f25b981edc760e46aa08c43 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 2 Oct 2015 18:40:38 +0200 Subject: Don't use flags in the group_by_handler class instead pass the whole query down and let the engine return unsupported parts back --- storage/sequence/sequence.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'storage') diff --git a/storage/sequence/sequence.cc b/storage/sequence/sequence.cc index d0d46495acf..36ccebfa86f 100644 --- a/storage/sequence/sequence.cc +++ b/storage/sequence/sequence.cc @@ -375,19 +375,17 @@ public: }; static group_by_handler * -create_group_by_handler(THD *thd, List *fields, TABLE_LIST *table_list, - ORDER *group_by, ORDER *order_by, Item *where, - Item *having) +create_group_by_handler(THD *thd, Query *query) { ha_seq_group_by_handler *handler; Item *item; - List_iterator_fast it(*fields); + List_iterator_fast it(*query->select); /* check that only one table is used in FROM clause and no sub queries */ - if (table_list->next_local != 0) + if (query->from->next_local != 0) return 0; /* check that there is no where clause and no group_by */ - if (where != 0 || group_by != 0) + if (query->where != 0 || query->group_by != 0) return 0; /* @@ -417,7 +415,7 @@ create_group_by_handler(THD *thd, List *fields, TABLE_LIST *table_list, Check that we are using the sequence table (the only table in the FROM clause) and not an outer table. */ - if (field->table != table_list->table) + if (field->table != query->from->table) return 0; /* Check that we are using a SUM() on the primary key */ if (strcmp(field->field_name, "seq")) @@ -425,7 +423,7 @@ create_group_by_handler(THD *thd, List *fields, TABLE_LIST *table_list, } /* Create handler and return it */ - handler= new ha_seq_group_by_handler(thd, fields, table_list); + handler= new ha_seq_group_by_handler(thd, query->select, query->from); return handler; } -- cgit v1.2.1