diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-10-02 18:40:38 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-10-05 17:14:15 +0200 |
commit | 21175bb31610cdfe7f25b981edc760e46aa08c43 (patch) | |
tree | a9ec787cc2feebf6e93e112468c693dec441e575 /storage/sequence | |
parent | 8dff1aa5dc3335587b64ebf52ef2f8d5af2a0488 (diff) | |
download | mariadb-git-21175bb31610cdfe7f25b981edc760e46aa08c43.tar.gz |
Don't use flags in the group_by_handler class
instead pass the whole query down and let the engine return
unsupported parts back
Diffstat (limited to 'storage/sequence')
-rw-r--r-- | storage/sequence/sequence.cc | 14 |
1 files changed, 6 insertions, 8 deletions
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<Item> *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<Item> it(*fields); + List_iterator_fast<Item> 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<Item> *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<Item> *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; } |