1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-1052 Use existed getSelectPlan as a basis for group_by_handler plan generation.

This commit is contained in:
Roman Nozdrin
2018-03-30 19:07:33 +03:00
parent fa4067b6f0
commit a47f16054d
5 changed files with 2522 additions and 45 deletions

View File

@ -178,8 +178,7 @@ struct cal_table_info
msTablePtr(0),
conn_hndl(0),
condInfo(0),
moreRows(false),
groupByFields(0)
moreRows(false)
{ }
~cal_table_info() {}
sm::cpsm_tplh_t* tpl_ctx;
@ -190,7 +189,27 @@ struct cal_table_info
gp_walk_info* condInfo;
execplan::SCSEP csep;
bool moreRows; //are there more rows to consume (b/c of limit)
List<Item> *groupByFields; // MCOL-1052 For CSEP generation
};
struct cal_group_info
{
cal_group_info() : groupByFields(0),
groupByTables(0),
groupByWhere(0),
groupByGroup(0),
groupByOrder(0),
groupByHaving(0),
groupByDistinct(false)
{ }
~cal_group_info() { }
List<Item>* groupByFields; // MCOL-1052 SELECT
TABLE_LIST* groupByTables; // MCOL-1052 FROM
Item* groupByWhere; // MCOL-1052 WHERE
ORDER* groupByGroup; // MCOL-1052 GROUP BY
ORDER* groupByOrder; // MCOL-1052 ORDER BY
Item* groupByHaving; // MCOL-1052 HAVING
bool groupByDistinct; //MCOL-1052 DISTINCT
};
typedef std::tr1::unordered_map<TABLE*, cal_table_info> CalTableMap;
@ -299,8 +318,9 @@ const std::string infinidb_err_msg = "\nThe query includes syntax that is not su
int cp_get_plan(THD* thd, execplan::SCSEP& csep);
int cp_get_table_plan(THD* thd, execplan::SCSEP& csep, cal_impl_if::cal_table_info& ti);
int cp_get_group_plan(THD* thd, execplan::SCSEP& csep, cal_impl_if::cal_table_info& ti);
int cp_get_group_plan(THD* thd, execplan::SCSEP& csep, cal_impl_if::cal_table_info& ti,cal_impl_if::cal_group_info& gi);
int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, execplan::SCSEP& csep, bool isUnion = false);
int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, execplan::SCSEP& csep,cal_group_info& gi, bool isUnion = false);
void setError(THD* thd, uint32_t errcode, const std::string errmsg, gp_walk_info* gwi);
void setError(THD* thd, uint32_t errcode, const std::string errmsg);
void gp_walk(const Item* item, void* arg);