You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
Merge pull request #267 from mariadb-corporation/MCOL-895-1.1
MCOL-895 Sort system catalog ridList
This commit is contained in:
@@ -3093,18 +3093,35 @@ const CalpontSystemCatalog::RIDList CalpontSystemCatalog::columnRIDs(const Table
|
|||||||
ctList[i].nextvalue = ((*it)->GetData(i));
|
ctList[i].nextvalue = ((*it)->GetData(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// MCOL-895 sort ctList, we can't specify an ORDER BY to do this yet
|
||||||
|
std::sort(ctList, ctList + ti.numOfCols, ctListSort);
|
||||||
|
|
||||||
// populate colinfo cache
|
// populate colinfo cache
|
||||||
lk3.lock();
|
lk3.lock();
|
||||||
for (int i = 0; i < ti.numOfCols; i++)
|
for (int i = 0; i < ti.numOfCols; i++)
|
||||||
fColinfomap[ctList[i].columnOID] = ctList[i];
|
fColinfomap[ctList[i].columnOID] = ctList[i];
|
||||||
lk3.unlock();
|
lk3.unlock();
|
||||||
|
|
||||||
|
// Re-sort the output based on the sorted ctList
|
||||||
|
// Don't need to do this for the cached list as this will be already sorted
|
||||||
|
RIDList rlOut;
|
||||||
|
for (int i = 0; i < ti.numOfCols; i++)
|
||||||
|
{
|
||||||
|
OID objid = ctList[i].columnOID;
|
||||||
|
for (size_t j = 0; j < rl.size(); j++)
|
||||||
|
{
|
||||||
|
if (rl[j].objnum == objid)
|
||||||
|
{
|
||||||
|
rlOut.push_back(rl[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delete [] ctList;
|
delete [] ctList;
|
||||||
// delete col[9];
|
// delete col[9];
|
||||||
if (rl.size() != 0)
|
if (rlOut.size() != 0)
|
||||||
{
|
{
|
||||||
return rl;
|
return rlOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
Message::Args args;
|
Message::Args args;
|
||||||
@@ -5788,5 +5805,10 @@ vector<CalpontSystemCatalog::OID> getAllSysCatOIDs()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ctListSort(const CalpontSystemCatalog::ColType& a, const CalpontSystemCatalog::ColType& b)
|
||||||
|
{
|
||||||
|
return a.colPosition < b.colPosition;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace execplan
|
} // namespace execplan
|
||||||
// vim:sw=4 ts=4:
|
// vim:sw=4 ts=4:
|
||||||
|
@@ -1247,6 +1247,8 @@ std::ostream& operator<<(std::ostream& os, const CalpontSystemCatalog::ColType&
|
|||||||
|
|
||||||
const std::string colDataTypeToString(CalpontSystemCatalog::ColDataType cdt);
|
const std::string colDataTypeToString(CalpontSystemCatalog::ColDataType cdt);
|
||||||
|
|
||||||
|
bool ctListSort(const CalpontSystemCatalog::ColType& a, const CalpontSystemCatalog::ColType& b);
|
||||||
|
|
||||||
} //namespace execplan
|
} //namespace execplan
|
||||||
|
|
||||||
#endif //EXECPLAN_CALPONTSYSTEMCATALOG_H
|
#endif //EXECPLAN_CALPONTSYSTEMCATALOG_H
|
||||||
|
Reference in New Issue
Block a user