diff --git a/dbcon/joblist/jlf_subquery.cpp b/dbcon/joblist/jlf_subquery.cpp index ab1ff36cd..ac2f4b950 100644 --- a/dbcon/joblist/jlf_subquery.cpp +++ b/dbcon/joblist/jlf_subquery.cpp @@ -823,7 +823,7 @@ void addOrderByAndLimit(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo) if (sc == NULL) { const ReturnedColumn* rc = dynamic_cast(orderByCols[i].get()); - uint32_t eid = rc->expressionId(); + uint64_t eid = rc->expressionId(); CalpontSystemCatalog::ColType ct = rc->resultType(); tupleKey = getExpTupleKey(jobInfo, eid); jobInfo.orderByColVec.push_back(make_pair(tupleKey, orderByCols[i]->asc())); diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index 2fb8fa788..1abed2c99 100755 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -7791,16 +7791,12 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, } } - SimpleColumn* sc = dynamic_cast(rc); - if (!sc || sc->oid()) - { - if (ordercol->direction == ORDER::ORDER_ASC) - rc->asc(true); - else - rc->asc(false); + if (ordercol->direction == ORDER::ORDER_ASC) + rc->asc(true); + else + rc->asc(false); - gwi.orderByCols.push_back(SRCP(rc)); - } + gwi.orderByCols.push_back(SRCP(rc)); } } // make sure columnmap, returnedcols and count(*) arg_list are not empty @@ -9587,16 +9583,12 @@ int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, cal_gro } } - SimpleColumn* sc = dynamic_cast(rc); - if (!sc || sc->oid()) - { - if (ordercol->direction == ORDER::ORDER_ASC) - rc->asc(true); - else - rc->asc(false); + if (ordercol->direction == ORDER::ORDER_ASC) + rc->asc(true); + else + rc->asc(false); - gwi.orderByCols.push_back(SRCP(rc)); - } + gwi.orderByCols.push_back(SRCP(rc)); }