{
TabInfoImpl ti = getNonCoreTI(catalog);
PermissionsCatalogRowFactory rf =
(PermissionsCatalogRowFactory)ti.getCatalogRowFactory();
ConglomerateController heapCC = tc.openConglomerate(
ti.getHeapConglomerate(), false, 0,
TransactionController.MODE_RECORD,
TransactionController.ISOLATION_REPEATABLE_READ);
DataValueDescriptor authIdOrderable = new SQLVarchar(authId);
ScanQualifier[][] scanQualifier = exFactory.getScanQualifier(1);
scanQualifier[0][0].setQualifier(
granteeColnoInIndex - 1, /* to zero-based */
authIdOrderable,
Orderable.ORDER_OP_EQUALS,
false,
false,
false);
ScanController sc = tc.openScan(
ti.getIndexConglomerate(indexNo),
false, // don't hold open across commit
0, // for update
TransactionController.MODE_RECORD,
TransactionController.ISOLATION_REPEATABLE_READ,
(FormatableBitSet) null, // all fields as objects
(DataValueDescriptor[]) null, // start position -
0, // startSearchOperation - none
scanQualifier, //
(DataValueDescriptor[]) null, // stop position -through last row
0); // stopSearchOperation - none
try {
ExecRow outRow = rf.makeEmptyRow();
ExecIndexRow indexRow = getIndexRowFromHeapRow(
ti.getIndexRowGenerator(indexNo),
heapCC.newRowLocationTemplate(),
outRow);
while (sc.fetchNext(indexRow.getRowArray())) {
RowLocation baseRowLocation = (RowLocation)indexRow.getColumn(
indexRow.nColumns());
boolean base_row_exists =
heapCC.fetch(
baseRowLocation, outRow.getRowArray(),
(FormatableBitSet)null);
if (SanityManager.DEBUG) {
// it can not be possible for heap row to
// disappear while holding scan cursor on index at
// ISOLATION_REPEATABLE_READ.
SanityManager.ASSERT(base_row_exists,
"base row doesn't exist");
}
if (action == DataDictionaryImpl.EXISTS) {
return true;
} else if (action == DataDictionaryImpl.DROP) {
PermissionsDescriptor perm = (PermissionsDescriptor)rf.
buildDescriptor(outRow,
(TupleDescriptor) null,
this);
removePermEntryInCache(perm);
ti.deleteRow(tc, indexRow, indexNo);
}
}
} finally {
if (sc != null) {
sc.close();
}
if (heapCC != null) {
heapCC.close();
}
}
return false;
}