UUID uuid,
ColumnDescriptorList cdl,
TupleDescriptor td)
throws StandardException
{
ColumnDescriptor cd;
ColumnDescriptorList cdlCopy = new ColumnDescriptorList();
DataValueDescriptor refIDOrderable = null;
TabInfoImpl ti = coreInfo[SYSCOLUMNS_CORE_NUM];
/* Use refIDOrderable in both start and stop position for scan. */
refIDOrderable = getIDValueAsCHAR(uuid);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(1);
keyRow.setColumn(1, refIDOrderable);
getDescriptorViaIndex(
SYSCOLUMNSRowFactory.SYSCOLUMNS_INDEX1_ID,
keyRow,
(ScanQualifier [][]) null,
ti,
td,
(ColumnDescriptorList) cdl,
false);
/* The TableDescriptor's column descriptor list must be ordered by
* columnNumber. (It is probably not ordered correctly at this point due
* to the index on syscolumns being on (tableId, columnName).) The
* cheapest way to reorder the list appears to be to copy it (above), and then
* walk the copy and put the elements back into the original in the
* expected locations.
*/
int cdlSize = cdl.size();
for (int index = 0; index < cdlSize; index++)
{
cdlCopy.add( cdl.get(index));
}
for (int index = 0; index < cdlSize; index++)
{
cd = (ColumnDescriptor) cdlCopy.elementAt(index);
cdl.set(cd.getPosition() - 1, cd);
}
}