int indexId,
int indexCol,
DataValueDescriptor schemaIdOrderable )
throws StandardException
{
ConglomerateController heapCC = null;
ExecIndexRow indexRow1;
ExecIndexRow indexTemplateRow;
ExecRow outRow;
ScanController scanController = null;
boolean foundRow;
FormatableBitSet colToCheck = new FormatableBitSet(indexCol);
CatalogRowFactory rf = ti.getCatalogRowFactory();
if (SanityManager.DEBUG)
{
SanityManager.ASSERT(indexId >= 0, "code needs to be enhanced"+
" to support a table scan to find the index id");
}
colToCheck.set(indexCol - 1);
ScanQualifier[][] qualifier = exFactory.getScanQualifier(1);
qualifier[0][0].setQualifier
(indexCol - 1,
schemaIdOrderable,
Orderable.ORDER_OP_EQUALS,
false,
false,
false);
outRow = rf.makeEmptyRow();
try
{
heapCC =
tc.openConglomerate(
ti.getHeapConglomerate(), false, 0,
TransactionController.MODE_RECORD,
TransactionController.ISOLATION_REPEATABLE_READ);
scanController = tc.openScan(
ti.getIndexConglomerate(indexId), // conglomerate to open
false, // don't hold open across commit
0, // for read
TransactionController.MODE_RECORD, // row locking
TransactionController.ISOLATION_REPEATABLE_READ,
colToCheck, // don't get any rows
null, // start position - first row
ScanController.GE, // startSearchOperation
qualifier, // scanQualifier,
null, // stop position - through last row
ScanController.GT); // stopSearchOperation
foundRow = (scanController.next());
}
finally
{
if (scanController != null)
{
scanController.close();
}
if (heapCC != null)
{
heapCC.close();
}
}
return foundRow;
}