{
ExecIndexRow keyRow1 = null;
ExecRow row;
DataValueDescriptor refIDOrderable;
DataValueDescriptor columnNameOrderable;
TabInfo ti = coreInfo[SYSCOLUMNS_CORE_NUM];
SYSCOLUMNSRowFactory rf = (SYSCOLUMNSRowFactory) ti.getCatalogRowFactory();
/* Use objectID/columnName in both start
* and stop position for index 1 scan.
*/
refIDOrderable = getValueAsDVD(formerUUID);
columnNameOrderable = dvf.getVarcharDataValue(formerName);
/* Set up the start/stop position for the scan */
keyRow1 = (ExecIndexRow) exFactory.getIndexableRow(2);
keyRow1.setColumn(1, refIDOrderable);
keyRow1.setColumn(2, columnNameOrderable);
// build the row to be stuffed into SYSCOLUMNS.
row = rf.makeRow(cd, null);
/*
** Figure out if the index in syscolumns needs
** to be updated.
*/
if (SanityManager.DEBUG)
{
SanityManager.ASSERT(rf.getNumIndexes() == 2,
"There are more indexes on syscolumns than expected, the code herein needs to change");
}
boolean[] bArray = new boolean[rf.getNumIndexes()];
/*
** Do we need to update indexes?
*/
if (colsToSet == null)
{
bArray[0] = true;
bArray[1] = true;
}
else
{
/*
** Check the specific columns for indexed
** columns.
*/
for (int i = 0; i < colsToSet.length; i++)
{
if ((colsToSet[i] == rf.SYSCOLUMNS_COLUMNNAME) ||
(colsToSet[i] == rf.SYSCOLUMNS_REFERENCEID))
{
bArray[0] = true;
break;
}
else if (colsToSet[i] == rf.SYSCOLUMNS_COLUMNDEFAULTID)
{
bArray[1] = true;
break;
}
}
}
ti.updateRow(keyRow1, row,
SYSCOLUMNSRowFactory.SYSCOLUMNS_INDEX1_ID,
bArray,
colsToSet,
tc,
wait);