diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index 243a1b389..fe896f774 100755 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -2984,6 +2984,7 @@ SimpleColumn* getSmallestColumn(boost::shared_ptr csc, } CalpontSystemCatalog::RIDList oidlist = csc->columnRIDs(tn, true); + idbassert(oidlist.size() == table->s->fields); CalpontSystemCatalog::TableColName tcn; int minColWidth = -1; int minWidthColOffset = 0; @@ -3008,7 +3009,7 @@ SimpleColumn* getSmallestColumn(boost::shared_ptr csc, sc->viewName(tan.view); sc->timeZone(gwi.thd->variables.time_zone->get_name()->ptr()); sc->resultType(csc->colType(oidlist[minWidthColOffset].objnum)); - sc->charsetNumber(3000); + sc->charsetNumber(table->field[minWidthColOffset]->charset()->number); return sc; }