diff --git a/dbcon/mysql/ha_calpont_impl.cpp b/dbcon/mysql/ha_calpont_impl.cpp index 6ac717deb..cdd93a859 100644 --- a/dbcon/mysql/ha_calpont_impl.cpp +++ b/dbcon/mysql/ha_calpont_impl.cpp @@ -5319,54 +5319,53 @@ int ha_cs_impl_select_next(uchar* buf, TABLE* table) sm::tableid_t tableid= execplan::IDB_VTABLE_ID; sm::cpsm_conhdl_t* hndl= ci->cal_conn_hndl; - if (ti.tpl_ctx == 0) - { - ti.tpl_ctx = new sm::cpsm_tplh_t(); - ti.tpl_scan_ctx = sm::sp_cpsm_tplsch_t(new sm::cpsm_tplsch_t()); - } - - // make sure rowgroup is null so the new meta data can be taken. This is for some case mysql - // call rnd_init for a table more than once. - ti.tpl_scan_ctx->rowGroup = NULL; - - try - { - sm::tpl_open(tableid, ti.tpl_ctx, hndl); - sm::tpl_scan_open(tableid, ti.tpl_scan_ctx, hndl); - } - catch (std::exception& e) - { - uint32_t sessionID = tid2sid(thd->thread_id); - string emsg = "table can not be opened: " + string(e.what()); - setError(thd, ER_INTERNAL_ERROR, emsg); - CalpontSystemCatalog::removeCalpontSystemCatalog(sessionID); - goto internal_error; - } - catch (...) - { - uint32_t sessionID = tid2sid(thd->thread_id); - string emsg = "table can not be opened"; - setError(thd, ER_INTERNAL_ERROR, emsg); - CalpontSystemCatalog::removeCalpontSystemCatalog(sessionID); - goto internal_error; - } - - ti.tpl_scan_ctx->traceFlags = ci->traceFlags; - - if ((ti.tpl_scan_ctx->ctp).size() == 0) - { - uint32_t num_attr = table->s->fields; - - for (uint32_t i = 0; i < num_attr; i++) - { - CalpontSystemCatalog::ColType ctype; - ti.tpl_scan_ctx->ctp.push_back(ctype); - } - } - ci->tableMap[table] = ti; - hndl->queryState= sm::QUERY_IN_PROCESS; + if (ti.tpl_ctx == 0) + { + ti.tpl_ctx = new sm::cpsm_tplh_t(); + ti.tpl_scan_ctx = sm::sp_cpsm_tplsch_t(new sm::cpsm_tplsch_t()); } + // make sure rowgroup is null so the new meta data can be taken. This is for some case mysql + // call rnd_init for a table more than once. + ti.tpl_scan_ctx->rowGroup = NULL; + + try + { + sm::tpl_open(tableid, ti.tpl_ctx, hndl); + sm::tpl_scan_open(tableid, ti.tpl_scan_ctx, hndl); + } + catch (std::exception& e) + { + uint32_t sessionID = tid2sid(thd->thread_id); + string emsg = "table can not be opened: " + string(e.what()); + setError(thd, ER_INTERNAL_ERROR, emsg); + CalpontSystemCatalog::removeCalpontSystemCatalog(sessionID); + goto internal_error; + } + catch (...) + { + uint32_t sessionID = tid2sid(thd->thread_id); + string emsg = "table can not be opened"; + setError(thd, ER_INTERNAL_ERROR, emsg); + CalpontSystemCatalog::removeCalpontSystemCatalog(sessionID); + goto internal_error; + } + + ti.tpl_scan_ctx->traceFlags = ci->traceFlags; + + if ((ti.tpl_scan_ctx->ctp).size() == 0) + { + uint32_t num_attr = table->s->fields; + + for (uint32_t i = 0; i < num_attr; i++) + { + CalpontSystemCatalog::ColType ctype; + ti.tpl_scan_ctx->ctp.push_back(ctype); + } + } + ci->tableMap[table] = ti; + hndl->queryState= sm::QUERY_IN_PROCESS; + if (!ti.tpl_ctx || !ti.tpl_scan_ctx) { uint32_t sessionID = tid2sid(thd->thread_id); diff --git a/dbcon/mysql/ha_mcs_pushdown.cpp b/dbcon/mysql/ha_mcs_pushdown.cpp index 48fae7624..94ffe92b2 100644 --- a/dbcon/mysql/ha_mcs_pushdown.cpp +++ b/dbcon/mysql/ha_mcs_pushdown.cpp @@ -415,7 +415,7 @@ create_columnstore_derived_handler(THD* thd, TABLE_LIST *derived) //G(V,E) where [V] = [E]+1 List join_preds_list; TABLE_LIST *tl; - for (tl= sl->get_table_list(); tl; tl= tl->next_local) + for (tl = sl->get_table_list(); !unsupported_feature && tl; tl = tl->next_local) { Item_cond* where_icp= 0; Item_cond* on_icp= 0; @@ -442,7 +442,8 @@ create_columnstore_derived_handler(THD* thd, TABLE_LIST *derived) // CROSS JOIN w/o conditions isn't supported until MCOL-301 // is ready. - if (join && join->table_count >= 2 && !join_preds_list.elements) + if (!unsupported_feature && join + && join->table_count >= 2 && !join_preds_list.elements) { unsupported_feature= true; }