diff --git a/dbcon/mysql/ha_calpont.cpp b/dbcon/mysql/ha_calpont.cpp index 1a1b0b5ec..a4ace792f 100644 --- a/dbcon/mysql/ha_calpont.cpp +++ b/dbcon/mysql/ha_calpont.cpp @@ -123,6 +123,9 @@ static int calpont_rollback(handlerton* hton, THD* thd, bool all); static int calpont_close_connection ( handlerton* hton, THD* thd ); handlerton* calpont_hton; +static group_by_handler * +create_calpont_group_by_handler(THD *thd, Query *query); + /* Variables for example share methods */ /* @@ -218,6 +221,7 @@ static int columnstore_init_func(void* p) calpont_hton->commit = calpont_commit; calpont_hton->rollback = calpont_rollback; calpont_hton->close_connection = calpont_close_connection; + calpont_hton->create_group_by = create_calpont_group_by_handler; DBUG_RETURN(0); } @@ -1135,6 +1139,22 @@ static MYSQL_SYSVAR_ULONG( 0); #endif +static group_by_handler * +create_calpont_group_by_handler(THD *thd, Query *query) +{ + ha_calpont_group_by_handler *handler; + Item *item; + List_iterator_fast it(*query->select); + + handler= new ha_calpont_group_by_handler(thd, query->select, query->from); + return handler; +} + +int ha_calpont_group_by_handler::next_row() +{ + return(0); +} + static struct st_mysql_sys_var* calpont_system_variables[] = { // MYSQL_SYSVAR(enum_var), diff --git a/dbcon/mysql/ha_calpont.h b/dbcon/mysql/ha_calpont.h index 6abaf51ed..b187c03d4 100644 --- a/dbcon/mysql/ha_calpont.h +++ b/dbcon/mysql/ha_calpont.h @@ -40,6 +40,8 @@ #include #include "idb_mysql.h" +extern handlerton* calpont_hton; + /** @brief EXAMPLE_SHARE is a structure that will be shared among all open handlers. This example implements the minimum of what you will probably need. @@ -245,5 +247,22 @@ public: } }; + +class ha_calpont_group_by_handler: public group_by_handler +{ + List *fields; + TABLE_LIST *table_list; + bool first_row; + +public: + ha_calpont_group_by_handler(THD *thd_arg, List *fields_arg, +TABLE_LIST *table_list_arg) + : group_by_handler(thd_arg, calpont_hton), fields(fields_arg), + table_list(table_list_arg) {} + ~ha_calpont_group_by_handler() {} + int init_scan() { first_row= true ; return 0; } + int next_row(); + int end_scan() { return 0; } +}; #endif //HA_CALPONT_H__