use of org.apache.derby.iapi.sql.execute.ExecIndexRow in project derby by apache.
the class DataDictionaryImpl method dropSubCheckConstraint.
/**
* Drop the matching row from syschecks when dropping a check constraint.
*
* @param constraintId The constraint id.
* @param tc The TransactionController
*
* @exception StandardException Thrown on failure
*/
private void dropSubCheckConstraint(UUID constraintId, TransactionController tc) throws StandardException {
ExecIndexRow checkRow1 = null;
DataValueDescriptor constraintIdOrderable;
TabInfoImpl ti = getNonCoreTI(SYSCHECKS_CATALOG_NUM);
/* Use constraintIdOrderable in both start
* and stop position for index 1 scan.
*/
constraintIdOrderable = getIDValueAsCHAR(constraintId);
/* Set up the start/stop position for the scan */
checkRow1 = (ExecIndexRow) exFactory.getIndexableRow(1);
checkRow1.setColumn(1, constraintIdOrderable);
ti.deleteRow(tc, checkRow1, SYSCHECKSRowFactory.SYSCHECKS_INDEX1_ID);
}
use of org.apache.derby.iapi.sql.execute.ExecIndexRow in project derby by apache.
the class DataDictionaryImpl method getConglomerateDescriptor.
/**
* Gets a conglomerate descriptor for the named index in the given schema,
* getting an exclusive row lock on the matching row in
* sys.sysconglomerates (for DDL concurrency) if requested.
*
* @param indexName The name of the index we're looking for
* @param sd The schema descriptor
* @param forUpdate Whether or not to get an exclusive row
* lock on the row in sys.sysconglomerates.
*
* @return A ConglomerateDescriptor describing the requested
* conglomerate. Returns NULL if no such conglomerate.
*
* @exception StandardException Thrown on failure
*/
public ConglomerateDescriptor getConglomerateDescriptor(String indexName, SchemaDescriptor sd, boolean forUpdate) throws StandardException {
ExecIndexRow keyRow2 = null;
DataValueDescriptor nameOrderable;
DataValueDescriptor schemaIDOrderable = null;
TabInfoImpl ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];
nameOrderable = new SQLVarchar(indexName);
schemaIDOrderable = getIDValueAsCHAR(sd.getUUID());
/* Set up the start/stop position for the scan */
keyRow2 = exFactory.getIndexableRow(2);
keyRow2.setColumn(1, nameOrderable);
keyRow2.setColumn(2, schemaIDOrderable);
return getDescriptorViaIndex(SYSCONGLOMERATESRowFactory.SYSCONGLOMERATES_INDEX2_ID, keyRow2, (ScanQualifier[][]) null, ti, (TupleDescriptor) null, (List<TupleDescriptor>) null, ConglomerateDescriptor.class, forUpdate);
}
use of org.apache.derby.iapi.sql.execute.ExecIndexRow in project derby by apache.
the class DataDictionaryImpl method dropAllRoutinePermDescriptors.
/**
* Drops all routine permission descriptors for the given routine.
*
* @param routineID The UUID of the routine from which to drop
* all the permission descriptors
* @param tc TransactionController for the transaction
*
* @exception StandardException Thrown on error
*/
public void dropAllRoutinePermDescriptors(UUID routineID, TransactionController tc) throws StandardException {
TabInfoImpl ti = getNonCoreTI(SYSROUTINEPERMS_CATALOG_NUM);
SYSROUTINEPERMSRowFactory rf = (SYSROUTINEPERMSRowFactory) ti.getCatalogRowFactory();
DataValueDescriptor routineIdOrderable;
ExecRow curRow;
PermissionsDescriptor perm;
// In Derby authorization mode, permission catalogs may not be present
if (!usesSqlAuthorization)
return;
/* Use tableIDOrderable in both start and stop position for scan. */
routineIdOrderable = getIDValueAsCHAR(routineID);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(1);
keyRow.setColumn(1, routineIdOrderable);
while ((curRow = ti.getRow(tc, keyRow, rf.ALIASID_INDEX_NUM)) != null) {
perm = (PermissionsDescriptor) rf.buildDescriptor(curRow, (TupleDescriptor) null, this);
removePermEntryInCache(perm);
// Build new key based on UUID and drop the entry as we want to drop
// only this row
ExecIndexRow uuidKey;
uuidKey = rf.buildIndexKeyRow(rf.ROUTINEPERMSID_INDEX_NUM, perm);
ti.deleteRow(tc, uuidKey, rf.ROUTINEPERMSID_INDEX_NUM);
}
}
use of org.apache.derby.iapi.sql.execute.ExecIndexRow in project derby by apache.
the class DataDictionaryImpl method getColumnDescriptorByDefaultId.
/**
* Drop all table descriptors for a schema.
*
* @param schema A descriptor for the schema to drop the tables
* from.
*
* @return Nothing.
*
* @exception StandardException Thrown on failure
*/
/*
public void dropAllTableDescriptors(SchemaDescriptor schema)
throws StandardException
{
if (SanityManager.DEBUG) SanityManager.NOTREACHED();
}
*/
/**
* Get a ColumnDescriptor given its Default ID.
*
* @param uuid The UUID of the default
*
* @return The ColumnDescriptor for the column.
*
* @exception StandardException Thrown on failure
*/
public ColumnDescriptor getColumnDescriptorByDefaultId(UUID uuid) throws StandardException {
DataValueDescriptor UUIDStringOrderable;
TabInfoImpl ti = coreInfo[SYSCOLUMNS_CORE_NUM];
/* Use UUIDStringOrderable in both start and stop positions for scan */
UUIDStringOrderable = getIDValueAsCHAR(uuid);
/* Set up the start/stop position for the scan */
ExecIndexRow keyRow = exFactory.getIndexableRow(1);
keyRow.setColumn(1, UUIDStringOrderable);
return getDescriptorViaIndex(SYSCOLUMNSRowFactory.SYSCOLUMNS_INDEX2_ID, keyRow, (ScanQualifier[][]) null, ti, (DefaultDescriptor) null, (List<TupleDescriptor>) null, ColumnDescriptor.class, false);
}
use of org.apache.derby.iapi.sql.execute.ExecIndexRow in project derby by apache.
the class DataDictionaryImpl method dropDependentsStoredDependencies.
/**
* @inheritDoc
*/
public void dropDependentsStoredDependencies(UUID dependentsUUID, TransactionController tc, boolean wait) throws StandardException {
ExecIndexRow keyRow1 = null;
DataValueDescriptor dependentIDOrderable;
TabInfoImpl ti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);
/* Use dependentIDOrderable in both start
* and stop position for index 1 scan.
*/
dependentIDOrderable = getIDValueAsCHAR(dependentsUUID);
/* Set up the start/stop position for the scan */
keyRow1 = (ExecIndexRow) exFactory.getIndexableRow(1);
keyRow1.setColumn(1, dependentIDOrderable);
ti.deleteRow(tc, keyRow1, SYSDEPENDSRowFactory.SYSDEPENDS_INDEX1_ID, wait);
}
Aggregations