|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.catalog.DataDictionaryImpl
public final class DataDictionaryImpl
Standard database implementation of the data dictionary that stores the information in the system catlogs.
Field Summary | |
---|---|
(package private) AccessFactory |
af
|
private java.lang.String |
authorizationDatabaseOwner
|
protected boolean |
booting
|
private TransactionController |
bootingTC
|
(package private) ShExLockable |
cacheCoordinator
|
(package private) int |
cacheMode
|
private java.util.GregorianCalendar |
calendarForLastSystemSQLName
|
private static java.lang.String |
CFG_SYSCOLUMNS_ID
|
private static java.lang.String |
CFG_SYSCOLUMNS_INDEX1_ID
|
private static java.lang.String |
CFG_SYSCOLUMNS_INDEX2_ID
|
private static java.lang.String |
CFG_SYSCONGLOMERATES_ID
|
private static java.lang.String |
CFG_SYSCONGLOMERATES_INDEX1_ID
|
private static java.lang.String |
CFG_SYSCONGLOMERATES_INDEX2_ID
|
private static java.lang.String |
CFG_SYSCONGLOMERATES_INDEX3_ID
|
private static java.lang.String |
CFG_SYSSCHEMAS_ID
|
private static java.lang.String |
CFG_SYSSCHEMAS_INDEX1_ID
|
private static java.lang.String |
CFG_SYSSCHEMAS_INDEX2_ID
|
private static java.lang.String |
CFG_SYSTABLES_ID
|
private static java.lang.String |
CFG_SYSTABLES_INDEX1_ID
|
private static java.lang.String |
CFG_SYSTABLES_INDEX2_ID
|
private int |
collationTypeOfSystemSchemas
Collation Type for SYSTEM schemas. |
private int |
collationTypeOfUserSchemas
Collation Type for user schemas. |
private static java.lang.String[] |
colPrivTypeMap
|
private static java.lang.String[] |
colPrivTypeMapForGrant
|
private TabInfoImpl[] |
coreInfo
|
DataDescriptorGenerator |
dataDescriptorGenerator
|
(package private) int |
ddlUsers
|
private SchemaDescriptor |
declaredGlobalTemporaryTablesSchemaDesc
|
private java.lang.String[][] |
DIAG_VTI_TABLE_CLASSES
|
private java.lang.String[][] |
DIAG_VTI_TABLE_FUNCTION_CLASSES
|
private DD_Version |
dictionaryVersion
Dictionary version of the on-disk database |
protected DependencyManager |
dmgr
|
(package private) static int |
DROP
Possible action for visitPermsByGrantee and visitRoleGrants. |
private DataValueFactory |
dvf
|
(package private) int |
engineType
|
private ExecutionFactory |
exFactory
|
(package private) static int |
EXISTS
Possible action for visitPermsByGrantee and visitRoleGrants. |
LockFactory |
lockFactory
|
(package private) CacheManager |
nameTdCache
|
private TabInfoImpl[] |
noncoreInfo
|
private static java.lang.String[] |
nonCoreNames
|
private static int |
NUM_CORE
|
private static int |
NUM_NONCORE
|
(package private) CacheManager |
OIDTdCache
|
(package private) CacheManager |
permissionsCache
|
(package private) int |
permissionsCacheSize
|
(package private) int |
readersInDDLMode
|
boolean |
readOnlyUpgrade
True if the database is read only and requires some form of upgrade, that makes the stored prepared statements invalid. |
private int |
seqgenCacheSize
|
private CacheManager |
sequenceGeneratorCache
|
private DD_Version |
softwareVersion
Dictionary version of the currently running engine |
private java.util.Hashtable |
spsIdHash
|
private CacheManager |
spsNameCache
|
private java.lang.String |
spsSet
|
(package private) java.util.Properties |
startupParameters
|
(package private) int |
stmtCacheSize
|
private static int |
SYSCOLUMNS_CORE_NUM
|
private static int |
SYSCONGLOMERATES_CORE_NUM
|
private static AliasDescriptor[] |
SYSFUN_AD
Runtime definition of the functions from SYSFUN_FUNCTIONS. |
private static int |
SYSFUN_DETERMINISTIC_INDEX
Index into SYSFUN_FUNCTIONS of the DETERMINISTIC indicator. |
private static int |
SYSFUN_FIRST_PARAMETER_INDEX
The index of the first parameter in entries in the SYSFUN_FUNCTIONS table. |
private static java.lang.String[][] |
SYSFUN_FUNCTIONS
SYSFUN functions. |
private SchemaDescriptor |
sysIBMSchemaDesc
|
private static int |
SYSSCHEMAS_CORE_NUM
|
private static int |
SYSTABLES_CORE_NUM
|
private SchemaDescriptor |
systemSchemaDesc
|
private static java.lang.String[] |
systemSchemaNames
List of all "system" schemas This list should contain all schema's used by the system and are created when the database is created. |
private int |
systemSQLNameNumber
|
private SchemaDescriptor |
systemUtilSchemaDesc
|
private static java.lang.String[] |
sysUtilFunctionsWithPublicAccess
List of functions in SYSCS_UTIL schema with PUBLIC access |
private static java.lang.String[] |
sysUtilProceduresWithPublicAccess
List of procedures in SYSCS_UTIL schema with PUBLIC access |
(package private) int |
tdCacheSize
|
private long |
timeForLastSystemSQLName
|
private boolean |
usesSqlAuthorization
|
protected UUIDFactory |
uuidFactory
|
Constructor Summary | |
---|---|
DataDictionaryImpl()
|
Method Summary | |
---|---|
boolean |
activeConstraint(ConstraintDescriptor constraint)
Reports whether an individual constraint must be enforced. |
void |
addConstraintDescriptor(ConstraintDescriptor descriptor,
TransactionController tc)
Adds the given ConstraintDescriptor to the data dictionary, associated with the given table and constraint type. |
void |
addDescriptor(TupleDescriptor td,
TupleDescriptor parent,
int catalogNumber,
boolean duplicatesAllowed,
TransactionController tc)
Adds a descriptor to a system catalog identified by the catalogNumber. |
void |
addDescriptorArray(TupleDescriptor[] td,
TupleDescriptor parent,
int catalogNumber,
boolean allowDuplicates,
TransactionController tc)
array version of addDescriptor. |
boolean |
addRemovePermissionsDescriptor(boolean add,
PermissionsDescriptor perm,
java.lang.String grantee,
TransactionController tc)
Add or remove a permission to/from the permission database. |
void |
addSPSDescriptor(SPSDescriptor descriptor,
TransactionController tc)
Adds the given SPSDescriptor to the data dictionary, associated with the given table and constraint type. |
private void |
addSPSParams(SPSDescriptor spsd,
TransactionController tc)
Add a column in SYS.SYSCOLUMNS for each parameter in the parameter list. |
private void |
addSubKeyConstraint(KeyConstraintDescriptor descriptor,
TransactionController tc)
Add the matching row to syskeys when adding a unique or primary key constraint |
(package private) void |
addSYSCOLUMNSIndex2Property(TransactionController tc,
long index2ConglomerateNumber)
|
private SchemaDescriptor |
addSystemSchema(java.lang.String schema_name,
java.lang.String schema_uuid,
TransactionController tc)
Add a system schema to the database. |
private void |
addSystemTableToDictionary(TabInfoImpl ti,
SchemaDescriptor sd,
TransactionController tc,
DataDescriptorGenerator ddg)
Add the required entries to the data dictionary for a System table. |
void |
addTableDescriptorToOtherCache(TableDescriptor td,
Cacheable c)
Add a table descriptor to the "other" cache. |
void |
boot(boolean create,
java.util.Properties startParams)
Start-up method for this instance of the data dictionary. |
private ConglomerateDescriptor |
bootstrapOneIndex(SchemaDescriptor sd,
TransactionController tc,
DataDescriptorGenerator ddg,
TabInfoImpl ti,
int indexNumber,
long heapConglomerateNumber)
|
private void |
bootStrapSystemIndexes(SchemaDescriptor sd,
TransactionController tc,
DataDescriptorGenerator ddg,
TabInfoImpl ti)
Infrastructure work for indexes on catalogs. |
boolean |
canSupport(java.util.Properties startParams)
This is the data dictionary implementation for the standard database engine. |
boolean |
checkVersion(int requiredMajorVersion,
java.lang.String feature)
Check to see if a database has been upgraded to the required level in order to use a language feature. |
void |
clearCaches()
Clear all of the DataDictionary caches. |
private void |
clearNoncoreTable(int nonCoreNum)
|
(package private) void |
clearSPSPlans()
Mark all SPS plans in the data dictionary invalid. |
RowLocation[] |
computeAutoincRowLocations(TransactionController tc,
TableDescriptor td)
returns an array of RowLocations corresponding to the autoincrement columns in the table. |
private RowLocation |
computeRowLocation(TransactionController tc,
TableDescriptor td,
java.lang.String columnName)
Computes the RowLocation in SYSCOLUMNS for a particular autoincrement column. |
(package private) void |
computeSequenceRowLocation(TransactionController tc,
java.lang.String sequenceIDstring,
RowLocation[] rowLocation,
SequenceDescriptor[] sequenceDescriptor)
Computes the RowLocation in SYSSEQUENCES for a particular sequence. |
(package private) void |
create_10_1_system_procedures(TransactionController tc,
java.util.HashSet newlyCreatedRoutines,
UUID sysUtilUUID)
Create system procedures added in version 10.1. |
(package private) void |
create_10_2_system_procedures(TransactionController tc,
java.util.HashSet newlyCreatedRoutines,
UUID sysUtilUUID)
Create system procedures added in version 10.2. |
(package private) void |
create_10_3_system_procedures_SYSCS_UTIL(TransactionController tc,
java.util.HashSet newlyCreatedRoutines)
Create system procedures that are part of the SYSCS_UTIL schema added in version 10.3. |
private void |
create_10_3_system_procedures_SYSIBM(TransactionController tc,
java.util.HashSet newlyCreatedRoutines)
Create system procedures added in version 10.3. |
(package private) void |
create_10_3_system_procedures(TransactionController tc,
java.util.HashSet newlyCreatedRoutines)
Create the System procedures that are added in 10.3. |
(package private) void |
create_10_5_system_procedures(TransactionController tc,
java.util.HashSet newlyCreatedRoutines)
Create the System procedures that are added to 10.5. |
(package private) void |
create_10_6_system_procedures(TransactionController tc,
java.util.HashSet newlyCreatedRoutines)
Create the System procedures that are added to 10.6. |
private void |
create_SYSCS_procedures(TransactionController tc,
java.util.HashSet newlyCreatedRoutines)
Create system procedures Used to add the system procedures to the database when it is created. |
protected void |
create_SYSIBM_procedures(TransactionController tc,
java.util.HashSet newlyCreatedRoutines)
Create system procedures in SYSIBM Used to add the system procedures to the database when it is created. |
private long |
createConglomerate(java.lang.String name,
TransactionController tc,
ExecRow rowTemplate,
java.util.Properties properties)
Create a conglomerate for a system table |
protected void |
createDictionaryTables(java.util.Properties params,
TransactionController tc,
DataDescriptorGenerator ddg)
Create all the required dictionary tables. |
RoleClosureIterator |
createRoleClosureIterator(TransactionController tc,
java.lang.String role,
boolean inverse)
This method creates a new iterator over the closure of role grants starting or ending with a given role. |
(package private) void |
createRoutinePermPublicDescriptor(UUID routineUUID,
TransactionController tc,
java.lang.String authorizationID)
Create RoutinePermDescriptor to grant access to PUBLIC for this system routine using the grantor specified in authorizationID. |
protected void |
createSPSSet(TransactionController tc,
boolean net,
UUID schemaID)
Create a set of stored prepared statements from a properties file. |
private UUID |
createSystemProcedureOrFunction(java.lang.String routine_name,
UUID schema_uuid,
java.lang.String[] arg_names,
TypeDescriptor[] arg_types,
int num_out_param,
int num_result_sets,
short routine_sql_control,
boolean isDeterministic,
TypeDescriptor return_type,
java.util.HashSet newlyCreatedRoutines,
TransactionController tc)
Generic create procedure routine. |
private UUID |
createSystemProcedureOrFunction(java.lang.String routine_name,
UUID schema_uuid,
java.lang.String[] arg_names,
TypeDescriptor[] arg_types,
int num_out_param,
int num_result_sets,
short routine_sql_control,
boolean isDeterministic,
TypeDescriptor return_type,
java.util.HashSet newlyCreatedRoutines,
TransactionController tc,
java.lang.String procClass)
Generic create procedure routine. |
(package private) void |
createSystemSps(TransactionController tc)
Create system built-in metadata stored prepared statements. |
private void |
debugGenerateInfo(java.lang.StringBuffer strbuf,
TransactionController tc,
ConglomerateController heapCC,
TabInfoImpl ti,
int indexId)
|
void |
doneReading(int mode,
LanguageConnectionContext lcc)
Inform this DataDictionary that we have finished reading it. |
void |
dropAliasDescriptor(AliasDescriptor ad,
TransactionController tc)
Drop a AliasDescriptor from the DataDictionary |
void |
dropAllColumnDescriptors(UUID tableID,
TransactionController tc)
Drops all column descriptors from the given table. |
void |
dropAllConglomerateDescriptors(TableDescriptor td,
TransactionController tc)
Drops all conglomerates associated with a table. |
void |
dropAllConstraintDescriptors(TableDescriptor table,
TransactionController tc)
Drops all ConstraintDescriptors from the data dictionary that are associated with the given table, |
void |
dropAllPermDescriptors(UUID objectID,
TransactionController tc)
Drops all permission descriptors for the object whose Id is given. |
void |
dropAllPermsByGrantee(java.lang.String authId,
TransactionController tc)
Drop all permission descriptors corresponding to a grant to the named authentication identifier |
void |
dropAllRoutinePermDescriptors(UUID routineID,
TransactionController tc)
Drops all routine permission descriptors for the given routine. |
void |
dropAllTableAndColPermDescriptors(UUID tableID,
TransactionController tc)
Drops all table and column permission descriptors for the given table. |
void |
dropColumnDescriptor(UUID tableID,
java.lang.String columnName,
TransactionController tc)
Given a column name and a table ID, drops the column descriptor from the table. |
private void |
dropColumnDescriptorCore(TransactionController tc,
ExecIndexRow keyRow)
Delete the appropriate rows from syscolumns when dropping 1 or more columns. |
private void |
dropColumnPermDescriptor(TransactionController tc,
ExecIndexRow keyRow)
Delete the appropriate rows from syscolperms when dropping a table |
void |
dropConglomerateDescriptor(ConglomerateDescriptor conglomerate,
TransactionController tc)
Drops a conglomerate descriptor |
void |
dropConstraintDescriptor(ConstraintDescriptor descriptor,
TransactionController tc)
Drops the given ConstraintDescriptor from the data dictionary. |
void |
dropDependentsStoredDependencies(UUID dependentsUUID,
TransactionController tc)
Remove all of the stored dependencies for a given dependent's ID from the data dictionary. |
void |
dropDependentsStoredDependencies(UUID dependentsUUID,
TransactionController tc,
boolean wait)
Remove all of the stored dependencies for a given dependent's ID from the data dictionary. |
void |
dropFileInfoDescriptor(FileInfoDescriptor fid)
Drop a FileDescriptor from the datadictionary. |
private void |
dropJDBCMetadataSPSes(TransactionController tc)
Remove metadata stored prepared statements. |
private void |
dropPermsByGrantee(java.lang.String authId,
TransactionController tc,
int catalog,
int indexNo,
int granteeColnoInIndex)
Presently only used when dropping roles - user dropping is not under Derby control (well, built-in users are if properties are stored in database), any permissions granted to users remain in place even if the user is no more. |
void |
dropRoleGrant(java.lang.String roleName,
java.lang.String grantee,
java.lang.String grantor,
TransactionController tc)
Drop a role grant |
void |
dropRoleGrantsByGrantee(java.lang.String grantee,
TransactionController tc)
Drop all role grants corresponding to a grant of (any) role to a named authentication identifier |
void |
dropRoleGrantsByName(java.lang.String roleName,
TransactionController tc)
Drop all role grants corresponding to a grant of the named role to any authentication identifier |
void |
dropSchemaDescriptor(java.lang.String schemaName,
TransactionController tc)
Drop the descriptor for a schema, given the schema's name |
void |
dropSequenceDescriptor(SequenceDescriptor descriptor,
TransactionController tc)
Drops a sequence descriptor |
void |
dropSPSDescriptor(SPSDescriptor descriptor,
TransactionController tc)
Drops the given SPSDescriptor. |
void |
dropSPSDescriptor(UUID uuid,
TransactionController tc)
Drops the given SPSDescriptor. |
void |
dropStatisticsDescriptors(UUID tableUUID,
UUID referenceUUID,
TransactionController tc)
Drops all statistics descriptors for a given table/index column combination. |
void |
dropStoredDependency(DependencyDescriptor dd,
TransactionController tc)
Drop a single dependency from the data dictionary. |
private void |
dropSubCheckConstraint(UUID constraintId,
TransactionController tc)
Drop the matching row from syschecks when dropping a check constraint. |
private void |
dropSubKeyConstraint(ConstraintDescriptor constraint,
TransactionController tc)
Drop the matching row from syskeys when dropping a primary key or unique constraint. |
void |
dropTableDescriptor(TableDescriptor td,
SchemaDescriptor schema,
TransactionController tc)
Drop the table descriptor. |
private void |
dropTablePermDescriptor(TransactionController tc,
ExecIndexRow keyRow)
Delete the appropriate rows from systableperms when dropping a table |
void |
dropTriggerDescriptor(TriggerDescriptor descriptor,
TransactionController tc)
Drops the given TriggerDescriptor. |
void |
dropViewDescriptor(ViewDescriptor vd,
TransactionController tc)
Drops the view descriptor from the data dictionary. |
private StandardException |
duplicateDescriptorException(TupleDescriptor tuple,
TupleDescriptor parent)
|
boolean |
existsGrantToAuthid(java.lang.String authId,
TransactionController tc)
Check all dictionary tables and return true if there is any GRANT descriptor containing authId as its grantee. |
private boolean |
existsPermByGrantee(java.lang.String authId,
TransactionController tc,
int catalog,
int indexNo,
int granteeColnoInIndex)
Return true if there exists a permission grant descriptor to this authorization id. |
private boolean |
existsRoleGrantByGrantee(java.lang.String grantee,
TransactionController tc)
Return true if there exists a role grant to authorization identifier. |
boolean |
existsSchemaOwnedBy(java.lang.String authid,
TransactionController tc)
Return true of there exists a schema whose authorizationId equals authid, i.e. |
void |
faultInTabInfo(TabInfoImpl ti)
Finishes building a TabInfoImpl if it hasn't already been faulted in. |
private java.lang.String |
findDefaultBuiltinAlgorithm()
Find the default message digest algorithm to use for BUILTIN authentication on this database. |
private TableDescriptor |
finishTableDescriptor(TableDescriptor td)
Finish filling in the TableDescriptor. |
ConstraintDescriptorList |
getActiveConstraintDescriptors(ConstraintDescriptorList cdl)
Convert a constraint descriptor list into a list of active constraints, that is, constraints which must be enforced. |
AliasDescriptor |
getAliasDescriptor(java.lang.String schemaId,
java.lang.String aliasName,
char nameSpace)
Get a AliasDescriptor by alias name and name space. |
AliasDescriptor |
getAliasDescriptor(UUID uuid)
Get a AliasDescriptor given its UUID. |
AliasDescriptor |
getAliasDescriptorForUDT(TransactionController tc,
DataTypeDescriptor dtd)
Get the alias descriptor for an ANSI UDT. |
private ConstraintDescriptorList |
getAllConstraintDescriptors()
Get every constraint in this database. |
java.util.List |
getAllDependencyDescriptorsList()
Build and return an List with DependencyDescriptors for all of the stored dependencies. |
java.util.List |
getAllSPSDescriptors()
Get every statement in this database. |
private GenericDescriptorList |
getAllTriggerDescriptors()
Get every trigger in this database. |
java.lang.String |
getAuthorizationDatabaseOwner()
Get authorizationID of Database Owner |
private long |
getBootParameter(java.util.Properties startParams,
java.lang.String key,
boolean required)
|
private void |
getBuiltinSystemSchemas()
Set up the builtin schema descriptors for system schemas. |
java.lang.String |
getBuiltinVTIClass(TableDescriptor td,
boolean asTableFunction)
Return the Java class to use for a builtin VTI to which the received table descriptor maps. |
int |
getCacheMode()
Returns the cache mode of the data dictionary. |
int |
getCollationTypeOfSystemSchemas()
Return the collation type for SYSTEM schemas. |
int |
getCollationTypeOfUserSchemas()
Return the collation type for user schemas. |
ColumnDescriptor |
getColumnDescriptorByDefaultId(UUID uuid)
Get a ColumnDescriptor given its Default ID. |
private void |
getColumnDescriptorsScan(TableDescriptor td)
Populate the ColumnDescriptorList for the specified TableDescriptor. |
private void |
getColumnDescriptorsScan(UUID uuid,
ColumnDescriptorList cdl,
TupleDescriptor td)
Populate the ColumnDescriptorList for the specified TableDescriptor. |
ColPermsDescriptor |
getColumnPermissions(UUID colPermsUUID)
Get one user's column privileges on a table using colPermsUUID |
ColPermsDescriptor |
getColumnPermissions(UUID tableUUID,
int privType,
boolean forGrant,
java.lang.String authorizationId)
Get one user's column privileges for a table. |
ColPermsDescriptor |
getColumnPermissions(UUID tableUUID,
java.lang.String privTypeStr,
boolean forGrant,
java.lang.String authorizationId)
Get one user's column privileges for a table. |
ConglomerateDescriptor |
getConglomerateDescriptor(long conglomerateNumber)
Get a ConglomerateDescriptor given its conglomerate number. |
ConglomerateDescriptor |
getConglomerateDescriptor(java.lang.String indexName,
SchemaDescriptor sd,
boolean forUpdate)
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. |
ConglomerateDescriptor |
getConglomerateDescriptor(UUID uuid)
Get a ConglomerateDescriptor given its UUID. |
ConglomerateDescriptor[] |
getConglomerateDescriptors(long conglomerateNumber)
Get an array of conglomerate descriptors for the given conglomerate number. |
ConglomerateDescriptor[] |
getConglomerateDescriptors(UUID uuid)
Get an array of ConglomerateDescriptors given the UUID. |
private void |
getConglomerateDescriptorsScan(TableDescriptor td)
Populate the ConglomerateDescriptorList for the specified TableDescriptor by scanning sysconglomerates. |
ConstraintDescriptor |
getConstraintDescriptor(java.lang.String constraintName,
UUID schemaID)
Get a ConstraintDescriptor given its name and schema ID. |
ConstraintDescriptor |
getConstraintDescriptor(TableDescriptor td,
UUID uuid)
Get the constraint descriptor given a table and the UUID String of the backing index. |
ConstraintDescriptor |
getConstraintDescriptor(UUID uuid)
Get a ConstraintDescriptor given its UUID. |
ConstraintDescriptor |
getConstraintDescriptorById(TableDescriptor td,
UUID uuid)
Get the constraint descriptor given a table and the UUID String of the constraint |
ConstraintDescriptor |
getConstraintDescriptorByName(TableDescriptor td,
SchemaDescriptor sd,
java.lang.String constraintName,
boolean forUpdate)
Get the constraint descriptor given a TableDescriptor and the constraint name. |
ConstraintDescriptorList |
getConstraintDescriptors(TableDescriptor td)
Load up the constraint descriptor list for this table descriptor and return it. |
private void |
getConstraintDescriptorsScan(TableDescriptor td,
boolean forUpdate)
Populate the ConstraintDescriptorList for the specified TableDescriptor. |
protected TupleDescriptor |
getConstraintDescriptorViaHeap(ScanQualifier[][] scanQualifiers,
TabInfoImpl ti,
TupleDescriptor parentTupleDescriptor,
java.util.List list)
Return a (single or list of) catalog row descriptor(s) from SYSCONSTRAINTS through a heap scan |
protected ConstraintDescriptor |
getConstraintDescriptorViaIndex(int indexId,
ExecIndexRow keyRow,
TabInfoImpl ti,
TableDescriptor td,
ConstraintDescriptorList dList,
boolean forUpdate)
Return a (single or list of) ConstraintDescriptor(s) from SYSCONSTRAINTS where the access is from the index to the heap. |
java.util.List |
getConstraints(UUID uuid,
int indexId,
int columnNum)
Return an List which of the relevant column matching the indexed criteria. |
TableDescriptor |
getConstraintTableDescriptor(UUID constraintId)
Return a table descriptor corresponding to the TABLEID field in SYSCONSTRAINTS where CONSTRAINTID matches the constraintId passsed in. |
void |
getCurrentValueAndAdvance(java.lang.String sequenceUUIDstring,
NumberDataValue returnValue)
Get the next number from an ANSI/ISO sequence generator which was created with the CREATE SEQUENCE statement. |
DataDescriptorGenerator |
getDataDescriptorGenerator()
Get a DataDescriptorGenerator, through which we can create objects to be stored in the DataDictionary. |
DataValueFactory |
getDataValueFactory()
Get a DataValueFactory, through which we can create data value objects. |
SchemaDescriptor |
getDeclaredGlobalTemporaryTablesSchemaDescriptor()
Get the descriptor for the declared global temporary table schema which is always named "SESSION". |
DependencyManager |
getDependencyManager()
returns the dependencymanager associated with this datadictionary. |
java.util.List |
getDependentsDescriptorList(java.lang.String dependentID)
Gets a list of the dependency descriptors for the given dependent's id. |
protected TupleDescriptor |
getDescriptorViaHeap(ScanQualifier[][] scanQualifiers,
TabInfoImpl ti,
TupleDescriptor parentTupleDescriptor,
java.util.List list)
Return a (single or list of) catalog row descriptor(s) from a system table where the access a heap scan |
private TupleDescriptor |
getDescriptorViaIndex(int indexId,
ExecIndexRow keyRow,
ScanQualifier[][] scanQualifiers,
TabInfoImpl ti,
TupleDescriptor parentTupleDescriptor,
java.util.List list,
boolean forUpdate)
Return a (single or list of) catalog row descriptor(s) from a system table where the access is from the index to the heap. |
private TupleDescriptor |
getDescriptorViaIndex(int indexId,
ExecIndexRow keyRow,
ScanQualifier[][] scanQualifiers,
TabInfoImpl ti,
TupleDescriptor parentTupleDescriptor,
java.util.List list,
boolean forUpdate,
int isolationLevel,
TransactionController tc)
Return a (single or list of) catalog row descriptor(s) from a system table where the access is from the index to the heap. |
private TupleDescriptor |
getDescriptorViaIndex(int indexId,
ExecIndexRow keyRow,
ScanQualifier[][] scanQualifiers,
TabInfoImpl ti,
TupleDescriptor parentTupleDescriptor,
java.util.List list,
boolean forUpdate,
TransactionController tc)
Return a (single or list of) catalog row descriptor(s) from a system table where the access is from the index to the heap. |
private TupleDescriptor |
getDescriptorViaIndexMinion(int indexId,
ExecIndexRow keyRow,
ScanQualifier[][] scanQualifiers,
TabInfoImpl ti,
TupleDescriptor parentTupleDescriptor,
java.util.List list,
boolean forUpdate,
int isolationLevel,
TransactionController tc)
|
int |
getEngineType()
|
ExecutionFactory |
getExecutionFactory()
Get ExecutionFactory associated with this database. |
FileInfoDescriptor |
getFileInfoDescriptor(SchemaDescriptor sd,
java.lang.String name)
Get a FileInfoDescriptor given its SQL name and schema name. |
FileInfoDescriptor |
getFileInfoDescriptor(UUID id)
Get a FileInfoDescriptor given its id. |
private FileInfoDescriptor |
getFileInfoDescriptorIndex1Scan(UUID schemaId,
java.lang.String name)
Scan sysfiles_index1 (schemaid,name) for a match. |
private FileInfoDescriptor |
getFileInfoDescriptorIndex2Scan(UUID id)
Scan sysfiles_index2 (id) for a match. |
ConstraintDescriptorList |
getForeignKeys(UUID constraintId)
Return a list of foreign keys constraints referencing this constraint. |
PermDescriptor |
getGenericPermissions(UUID permUUID)
Get one user's privileges for an object using the permUUID. |
PermDescriptor |
getGenericPermissions(UUID objectUUID,
java.lang.String objectType,
java.lang.String privilege,
java.lang.String granteeAuthId)
Get permissions granted to one user for an object using the object's Id and the user's authorization Id. |
private static SQLChar |
getIDValueAsCHAR(UUID uuid)
Converts a UUID to an DataValueDescriptor. |
static ExecIndexRow |
getIndexRowFromHeapRow(IndexRowGenerator irg,
RowLocation rl,
ExecRow heapRow)
Get an index row based on a row from the heap. |
private static LanguageConnectionContext |
getLCC()
|
private TabInfoImpl |
getNonCoreTI(int catalogNumber)
Get a TabInfoImpl for a non-core table. |
protected TabInfoImpl |
getNonCoreTIByNumber(int catalogNumber)
returns the tabinfo for a non core system catalog. |
private java.lang.Object |
getPermissions(PermissionsDescriptor key)
|
private CacheManager |
getPermissionsCache()
|
java.util.List |
getProvidersDescriptorList(java.lang.String providerID)
Gets a list of the dependency descriptors for the given provider's id. |
private java.util.Properties |
getQueryDescriptions(boolean net)
|
RoleGrantDescriptor |
getRoleDefinitionDescriptor(java.lang.String roleName)
Get the target role definition by searching for a matching row in SYSROLES by rolename where isDef==true. |
RoleGrantDescriptor |
getRoleGrantDescriptor(java.lang.String roleName,
java.lang.String grantee,
java.lang.String grantor)
Get the target role by searching for a matching row in SYSROLES by rolename, grantee and grantor. |
RoleGrantDescriptor |
getRoleGrantDescriptor(UUID uuid)
Get the role grant descriptor corresponding to the uuid provided |
(package private) java.util.HashMap |
getRoleGrantGraph(TransactionController tc,
boolean inverse)
Return an in-memory representation of the role grant graph (sans grant of roles to users, only role-role relation. |
java.util.List |
getRoutineList(java.lang.String schemaID,
java.lang.String routineName,
char nameSpace)
Get the list of routines matching the schema and routine name. |
RoutinePermsDescriptor |
getRoutinePermissions(UUID routinePermsUUID)
Get one user's privileges for a routine using routinePermsUUID |
RoutinePermsDescriptor |
getRoutinePermissions(UUID routineUUID,
java.lang.String authorizationId)
Get one user's permissions for a routine (function or procedure). |
RowLocation |
getRowLocationTemplate(LanguageConnectionContext lcc,
TableDescriptor td)
|
SchemaDescriptor |
getSchemaDescriptor(java.lang.String schemaName,
TransactionController tc,
boolean raiseError)
Get the descriptor for the named schema. |
SchemaDescriptor |
getSchemaDescriptor(UUID schemaId,
int isolationLevel,
TransactionController tc)
Get the SchemaDescriptor for the given schema identifier. |
SchemaDescriptor |
getSchemaDescriptor(UUID schemaId,
TransactionController tc)
Get the SchemaDescriptor for the given schema identifier. |
private SchemaDescriptor |
getSchemaDescriptorBody(UUID schemaId,
int isolationLevel,
TransactionController tc)
|
SequenceDescriptor |
getSequenceDescriptor(SchemaDescriptor sd,
java.lang.String sequenceName)
Get the sequence descriptor given a sequence name and a schema Id. |
SequenceDescriptor |
getSequenceDescriptor(UUID uuid)
get a descriptor for a Sequence by uuid |
NumberDataValue |
getSetAutoincrementValue(RowLocation rl,
TransactionController tc,
boolean doUpdate,
NumberDataValue newValue,
boolean wait)
getSetAutoincrementValue fetches the autoincrement value from SYSCOLUMNS given a row location. |
SPSDescriptor |
getSPSDescriptor(java.lang.String stmtName,
SchemaDescriptor sd)
Get a SPSDescriptor given its name. |
SPSDescriptor |
getSPSDescriptor(UUID uuid)
Get a SPSDescriptor given its UUID. |
private SPSDescriptor |
getSPSDescriptorIndex1Scan(java.lang.String stmtName,
java.lang.String schemaUUID)
Scan sysschemas_index1 (stmtname, schemaid) for a match. |
private SPSDescriptor |
getSPSDescriptorIndex2Scan(java.lang.String stmtUUID)
Scan sysstatements_index2 (stmtid) for a match. |
DataTypeDescriptor[] |
getSPSParams(SPSDescriptor spsd,
java.util.Vector defaults)
Get all the parameter descriptors for an SPS. |
java.util.List |
getStatisticsDescriptors(TableDescriptor td)
get all the statistiscs descriptors for a given table. |
private SubCheckConstraintDescriptor |
getSubCheckConstraint(UUID constraintId)
Get a SubCheckConstraintDescriptor from syschecks for the specified constraint id. |
SubKeyConstraintDescriptor |
getSubKeyConstraint(UUID constraintId,
int type)
Get a SubKeyConstraintDescriptor from syskeys or sysforeignkeys for the specified constraint id. |
long |
getSYSCOLUMNSHeapConglomerateNumber()
Get the heap conglomerate number for SYS.SYSCOLUMNS. |
SchemaDescriptor |
getSysIBMSchemaDescriptor()
Get the descriptor for the SYSIBM schema. |
SchemaDescriptor |
getSystemSchemaDescriptor()
Get the descriptor for the system schema. |
java.lang.String |
getSystemSQLName()
Returns a unique system generated name of the form SQLyymmddhhmmssxxn yy - year, mm - month, dd - day of month, hh - hour, mm - minute, ss - second, xx - the first 2 digits of millisec because we don't have enough space to keep the exact millisec value, n - number between 0-9 The number at the end is to handle more than one system generated name request came at the same time. |
SchemaDescriptor |
getSystemUtilSchemaDescriptor()
Get the descriptor for the SYSCS_UTIL system schema. |
TableDescriptor |
getTableDescriptor(java.lang.String tableName,
SchemaDescriptor schema,
TransactionController tc)
Get the descriptor for the named table within the given schema. |
TableDescriptor |
getTableDescriptor(UUID tableID)
Get the descriptor for the table with the given UUID. |
private TableDescriptor |
getTableDescriptorIndex1Scan(java.lang.String tableName,
java.lang.String schemaUUID)
Scan systables_index1 (tablename, schemaid) for a match. |
private TableDescriptor |
getTableDescriptorIndex2Scan(java.lang.String tableUUID)
Scan systables_index2 (tableid) for a match. |
TablePermsDescriptor |
getTablePermissions(UUID tablePermsUUID)
Get one user's privileges on a table using tablePermsUUID |
TablePermsDescriptor |
getTablePermissions(UUID tableUUID,
java.lang.String authorizationId)
Get one user's privileges on a table |
TransactionController |
getTransactionCompile()
Get the TransactionController to use, when not passed in as a parameter. |
TransactionController |
getTransactionExecute()
Get the TransactionController to use, when not passed in as a parameter. |
TriggerDescriptor |
getTriggerDescriptor(java.lang.String name,
SchemaDescriptor sd)
Get the stored prepared statement descriptor given a sps name. |
TriggerDescriptor |
getTriggerDescriptor(UUID uuid)
Get a TriggerDescriptor given its UUID. |
GenericDescriptorList |
getTriggerDescriptors(TableDescriptor td)
Load up the trigger descriptor list for this table descriptor and return it. |
private void |
getTriggerDescriptorsScan(TableDescriptor td,
boolean forUpdate)
Populate the GenericDescriptorList for the specified TableDescriptor. |
(package private) ColPermsDescriptor |
getUncachedColPermsDescriptor(ColPermsDescriptor key)
Get a column permissions descriptor from the system tables, without going through the cache. |
(package private) PermDescriptor |
getUncachedGenericPermDescriptor(PermDescriptor key)
Get an object's permission descriptor from the system tables, without going through the cache. |
private TupleDescriptor |
getUncachedPermissionsDescriptor(int catalogNumber,
int indexNumber,
PermissionsDescriptor key)
|
(package private) RoutinePermsDescriptor |
getUncachedRoutinePermsDescriptor(RoutinePermsDescriptor key)
Get a routine permissions descriptor from the system tables, without going through the cache. |
SPSDescriptor |
getUncachedSPSDescriptor(TableKey stmtKey)
This method can get called from the DataDictionary cache. |
protected SPSDescriptor |
getUncachedSPSDescriptor(UUID stmtId)
This method can get called from the DataDictionary cache. |
(package private) TableDescriptor |
getUncachedTableDescriptor(TableKey tableKey)
This method can get called from the DataDictionary cache. |
protected TableDescriptor |
getUncachedTableDescriptor(UUID tableID)
This method can get called from the DataDictionary cache. |
(package private) TablePermsDescriptor |
getUncachedTablePermsDescriptor(TablePermsDescriptor key)
Get a table permissions descriptor from the system tables, without going through the cache. |
UUIDFactory |
getUUIDFactory()
Get the UUID Factory. |
private UUID |
getUUIDForCoreTable(java.lang.String tableName,
java.lang.String schemaUUID,
TransactionController tc)
Get the UUID for the specified system table. |
ViewDescriptor |
getViewDescriptor(TableDescriptor td)
Gets the viewDescriptor for the view given the TableDescriptor. |
ViewDescriptor |
getViewDescriptor(UUID uuid)
Gets the viewDescriptor for the view with the given UUID. |
private ViewDescriptor |
getViewDescriptorScan(TableDescriptor tdi)
Get the information for the view from sys.sysviews. |
java.lang.String |
getVTIClass(TableDescriptor td,
boolean asTableFunction)
Return the Java class to use for the VTI to which the received table descriptor maps. |
private void |
grantPublicAccessToSystemRoutine(java.lang.String schemaID,
java.lang.String routineName,
char nameSpace,
TransactionController tc,
java.lang.String authorizationID)
Grant PUBLIC access to a system routine. |
void |
grantPublicAccessToSystemRoutines(java.util.HashSet newlyCreatedRoutines,
TransactionController tc,
java.lang.String authorizationID)
Grant PUBLIC access to specific system routines. |
java.util.Hashtable |
hashAllConglomerateDescriptorsByNumber(TransactionController tc)
Get all of the ConglomerateDescriptors in the database and hash them by conglomerate number. |
java.util.Hashtable |
hashAllTableDescriptorsByTableId(TransactionController tc)
Get all of the TableDescriptors in the database and hash them by TableId This is useful as a performance optimization for the locking VTIs. |
void |
initializeCatalogInfo()
Initialize catalog information. |
private void |
initializeCoreInfo()
Initialized the core info array. |
private void |
initializeNoncoreInfo()
Initialized the noncore info array. |
void |
initSystemIndexVariables(DataDescriptorGenerator ddg,
TabInfoImpl ti,
int indexNumber)
|
protected void |
initSystemIndexVariables(TabInfoImpl ti)
|
void |
invalidateAllSPSPlans()
Invalidate all the stored plans in SYS.SYSSTATEMENTS. |
boolean |
isSchemaEmpty(SchemaDescriptor sd)
Indicate whether there is anything in the particular schema. |
protected boolean |
isSchemaReferenced(TransactionController tc,
TabInfoImpl ti,
int indexId,
int indexCol,
DataValueDescriptor schemaIdOrderable)
Is the schema id referenced by the system table in question? |
boolean |
isSystemSchemaName(java.lang.String name)
Determine whether a string is the name of the system schema. |
void |
loadCatalogs(DataDescriptorGenerator ddg,
TabInfoImpl[] catalogArray)
Initialize indices for an array of catalogs |
protected void |
loadDictionaryTables(TransactionController tc,
DataDescriptorGenerator ddg,
java.util.Properties startParams)
Initialize system catalogs. |
private SchemaDescriptor |
locateSchemaRow(java.lang.String schemaName,
TransactionController tc)
Get the target schema by searching for a matching row in SYSSCHEMAS by schema name. |
private SchemaDescriptor |
locateSchemaRow(UUID schemaId,
int isolationLevel,
TransactionController tc)
Get the target schema by searching for a matching row in SYSSCHEMAS by schemaId. |
private SchemaDescriptor |
locateSchemaRow(UUID schemaId,
TransactionController tc)
Get the target schema by searching for a matching row in SYSSCHEMAS by schemaId. |
private SchemaDescriptor |
locateSchemaRowBody(UUID schemaId,
int isolationLevel,
TransactionController tc)
|
void |
makeCatalog(TabInfoImpl ti,
SchemaDescriptor sd,
TransactionController tc)
The dirty work of creating a catalog. |
private ColumnDescriptor |
makeColumnDescriptor(SystemColumn column,
int columnPosition,
TableDescriptor td)
Converts a SystemColumn to a ColumnDescriptor. |
Cacheable |
newCacheable(CacheManager cm)
|
private SchemaDescriptor |
newDeclaredGlobalTemporaryTablesSchemaDesc(java.lang.String name)
|
private static java.util.List |
newSList()
|
private SchemaDescriptor |
newSystemSchemaDesc(java.lang.String name,
java.lang.String uuid)
|
protected void |
populateSYSDUMMY1(TransactionController tc)
Populate SYSDUMMY1 table with a single row. |
private void |
removePermEntryInCache(PermissionsDescriptor perm)
Remove PermissionsDescriptor from permissions cache if present |
void |
resetDatabaseOwner(TransactionController tc)
Reset the database owner according to what is stored in the catalogs. |
private void |
rewriteSYSCOLPERMSforAlterTable(UUID tableID,
TransactionController tc,
ColumnDescriptor columnDescriptor)
Workhorse for ALTER TABLE-driven mods to SYSCOLPERMS This method finds all the SYSCOLPERMS rows for this table. |
java.lang.Object |
run()
|
void |
setAutoincrementValue(TransactionController tc,
UUID tableUUID,
java.lang.String columnName,
long aiValue,
boolean incrementNeeded)
sets a new value in SYSCOLUMNS for a particular autoincrement column. |
private void |
setCacheMode(int newMode)
|
protected void |
setDependencyManager()
sets the dependencymanager associated with this dd. subclasses can override this to install their own funky dependency manager. |
(package private) void |
spsCacheEntryAdded(SPSDescriptor spsd)
Add an entry to the hashtables for lookup from the cache. |
(package private) void |
spsCacheEntryRemoved(SPSDescriptor spsd)
|
int |
startReading(LanguageConnectionContext lcc)
Inform this DataDictionary that we are about to start reading it. |
void |
startWriting(LanguageConnectionContext lcc)
Inform this DataDictionary that we are about to start writing to it. |
void |
stop()
Stop this module. |
void |
transactionFinished()
Inform this DataDictionary that the transaction in which writes have been done (or may have been done) has been committed or rolled back. |
private static java.lang.String |
twoDigits(int val)
|
private void |
updateColumnDescriptor(ColumnDescriptor cd,
UUID formerUUID,
java.lang.String formerName,
int[] colsToSet,
TransactionController tc)
Update the column descriptor in question. |
void |
updateConglomerateDescriptor(ConglomerateDescriptor[] cds,
long conglomerateNumber,
TransactionController tc)
Update the conglomerateNumber for an array of ConglomerateDescriptors. |
void |
updateConglomerateDescriptor(ConglomerateDescriptor cd,
long conglomerateNumber,
TransactionController tc)
Update the conglomerateNumber for a ConglomerateDescriptor. |
void |
updateConstraintDescriptor(ConstraintDescriptor cd,
UUID formerUUID,
int[] colsToSet,
TransactionController tc)
Update the constraint descriptor in question. |
(package private) boolean |
updateCurrentSequenceValue(TransactionController tc,
RowLocation rowLocation,
boolean wait,
java.lang.Long oldValue,
java.lang.Long newValue)
Set the current value of an ANSI/ISO sequence. |
void |
updateLockGranularity(TableDescriptor td,
SchemaDescriptor schema,
char lockGranularity,
TransactionController tc)
Update the lockGranularity for the specified table. |
void |
updateMetadataSPSes(TransactionController tc)
Drop and recreate metadata stored prepared statements. |
void |
updateSchemaAuth(java.lang.String schemaName,
java.lang.String authorizationId,
TransactionController tc)
Update authorizationId of specified schemaName |
void |
updateSPS(SPSDescriptor spsd,
TransactionController tc,
boolean recompile,
boolean updateParamDescriptors,
boolean firstCompilation)
Updates SYS.SYSSTATEMENTS with the info from the SPSD. |
void |
updateSYSCOLPERMSforAddColumnToUserTable(UUID tableID,
TransactionController tc)
Need to update SYSCOLPERMS for a given table because a new column has been added to that table. |
void |
updateSYSCOLPERMSforDropColumn(UUID tableID,
TransactionController tc,
ColumnDescriptor columnDescriptor)
Update SYSCOLPERMS due to dropping a column from a table. |
void |
updateSystemSchemaAuthorization(java.lang.String aid,
TransactionController tc)
Update all system schemas to have new authorizationId. |
void |
updateTriggerDescriptor(TriggerDescriptor triggerd,
UUID formerUUID,
int[] colsToSet,
TransactionController tc)
Update the trigger descriptor in question. |
void |
upgrade_addColumns(CatalogRowFactory rowFactory,
int[] newColumnIDs,
TransactionController tc)
Upgrade an existing catalog by adding columns. |
void |
upgrade_addInvisibleColumns(CatalogRowFactory rowFactory,
int[] newColumnIDs,
TransactionController tc)
Add invisible columns to an existing system catalog |
(package private) void |
upgrade_initSystemTableCols(TransactionController tc,
boolean isCoreTable,
int tableNum,
FormatableBitSet columnsToUpdateSet,
DataValueDescriptor[] replaceRow)
Initialize noncore columns to fixed values |
long |
upgrade_makeOneIndex(TransactionController tc,
TabInfoImpl ti,
int indexNumber,
long heapConglomerateNumber)
Code to add an index to a catalog during upgrade. |
(package private) void |
upgradeCLOBGETSUBSTRING_10_6(TransactionController tc)
10.6 upgrade logic to update the return type of SYSIBM.CLOBGETSUBSTRING. |
void |
upgradeFixSystemColumnDefinition(CatalogRowFactory rowFactory,
int columnNumber,
TransactionController tc)
Upgrade an existing system catalog column's definition by setting it to the value it would have in a newly created database. |
protected void |
upgradeMakeCatalog(TransactionController tc,
int catalogNumber)
called by the upgrade code (dd_xena etc) to add a new system catalog. |
(package private) void |
upgradeSYSROUTINEPERMS_10_6(TransactionController tc)
10.6 upgrade logic to update the permissions granted to SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE. |
boolean |
usesSqlAuthorization()
Get authorization model in force, SqlStandard or legacy mode |
private boolean |
visitPermsByGrantee(java.lang.String authId,
TransactionController tc,
int catalog,
int indexNo,
int granteeColnoInIndex,
int action)
Scan indexNo index on a permission table
catalog , looking for match(es) for the grantee column
(given by granteeColnoInIndex for the catalog in question). |
private boolean |
visitRoleGrants(TabInfoImpl ti,
SYSROLESRowFactory rf,
int columnNo,
java.lang.String authId,
TransactionController tc,
int action)
Scan the {roleid, grantee, grantor} index on SYSROLES, locate rows containing authId in column columnNo. |
private void |
widenConglomerate(ExecRow templateRow,
int[] newColumnIDs,
long conglomID,
TransactionController tc)
Adds columns to the conglomerate underlying a system table. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String CFG_SYSTABLES_ID
private static final java.lang.String CFG_SYSTABLES_INDEX1_ID
private static final java.lang.String CFG_SYSTABLES_INDEX2_ID
private static final java.lang.String CFG_SYSCOLUMNS_ID
private static final java.lang.String CFG_SYSCOLUMNS_INDEX1_ID
private static final java.lang.String CFG_SYSCOLUMNS_INDEX2_ID
private static final java.lang.String CFG_SYSCONGLOMERATES_ID
private static final java.lang.String CFG_SYSCONGLOMERATES_INDEX1_ID
private static final java.lang.String CFG_SYSCONGLOMERATES_INDEX2_ID
private static final java.lang.String CFG_SYSCONGLOMERATES_INDEX3_ID
private static final java.lang.String CFG_SYSSCHEMAS_ID
private static final java.lang.String CFG_SYSSCHEMAS_INDEX1_ID
private static final java.lang.String CFG_SYSSCHEMAS_INDEX2_ID
private static final int SYSCONGLOMERATES_CORE_NUM
private static final int SYSTABLES_CORE_NUM
private static final int SYSCOLUMNS_CORE_NUM
private static final int SYSSCHEMAS_CORE_NUM
private static final int NUM_CORE
private static final java.lang.String[][] SYSFUN_FUNCTIONS
SELECT COS(angle) FROM ROOM_WALLS
Adding a function here is suitable when the function defintion
can have a single return type and fixed parameter types.
Functions that need to have a return type based upon the
input type(s) are not supported here. Typically those are
added into the parser and methods added into the DataValueDescriptor interface.
Examples are character based functions whose return type
length is based upon the passed in type, e.g. passed a CHAR(10)
returns a CHAR(10).
This simple table can handle an arbitrary number of arguments
and RETURNS NULL ON NULL INPUT. The scheme could be expanded
to handle other function options such as other parameters if needed.
[0] = FUNCTION name
[1] = RETURNS type
[2] = Java class
[3] = method name and signature
[4] = "true" or "false" depending on whether the function is DETERMINSTIC
[5..N] = arguments (optional, if not present zero arguments is assumed)
private static final int SYSFUN_DETERMINISTIC_INDEX
private static final int SYSFUN_FIRST_PARAMETER_INDEX
private static final AliasDescriptor[] SYSFUN_AD
private TabInfoImpl[] coreInfo
private SchemaDescriptor systemSchemaDesc
private SchemaDescriptor sysIBMSchemaDesc
private SchemaDescriptor declaredGlobalTemporaryTablesSchemaDesc
private SchemaDescriptor systemUtilSchemaDesc
private static final java.lang.String[] nonCoreNames
private static final int NUM_NONCORE
private static final java.lang.String[] systemSchemaNames
This list should contain all schema's used by the system and are created when the database is created. Users should not be able to create or drop these schema's and should not be able to create or drop objects in these schema's. This list is used by code that needs to check if a particular schema is a "system" schema.
private DD_Version dictionaryVersion
private DD_Version softwareVersion
private java.lang.String authorizationDatabaseOwner
private boolean usesSqlAuthorization
private TabInfoImpl[] noncoreInfo
public DataDescriptorGenerator dataDescriptorGenerator
private DataValueFactory dvf
AccessFactory af
private ExecutionFactory exFactory
protected UUIDFactory uuidFactory
java.util.Properties startupParameters
int engineType
protected boolean booting
private TransactionController bootingTC
protected DependencyManager dmgr
CacheManager OIDTdCache
CacheManager nameTdCache
private CacheManager spsNameCache
private CacheManager sequenceGeneratorCache
private java.util.Hashtable spsIdHash
int tdCacheSize
int stmtCacheSize
private int seqgenCacheSize
CacheManager permissionsCache
int permissionsCacheSize
ShExLockable cacheCoordinator
public LockFactory lockFactory
volatile int cacheMode
volatile int ddlUsers
volatile int readersInDDLMode
public boolean readOnlyUpgrade
In 5.2 and newer this will be the case if the engine booting the database is newer than the engine that created it.
private int systemSQLNameNumber
private java.util.GregorianCalendar calendarForLastSystemSQLName
private long timeForLastSystemSQLName
private static final java.lang.String[] sysUtilProceduresWithPublicAccess
private static final java.lang.String[] sysUtilFunctionsWithPublicAccess
private int collationTypeOfSystemSchemas
private int collationTypeOfUserSchemas
static final int DROP
static final int EXISTS
private java.lang.String spsSet
private static final java.lang.String[] colPrivTypeMap
private static final java.lang.String[] colPrivTypeMapForGrant
private java.lang.String[][] DIAG_VTI_TABLE_CLASSES
private java.lang.String[][] DIAG_VTI_TABLE_FUNCTION_CLASSES
Constructor Detail |
---|
public DataDictionaryImpl()
Method Detail |
---|
public boolean canSupport(java.util.Properties startParams)
canSupport
in interface ModuleSupportable
public void boot(boolean create, java.util.Properties startParams) throws StandardException
boot
in interface ModuleControl
startParams
- The start-up parameters
StandardException
- Thrown if the module fails to startMonitor
,
ModuleFactory
private java.lang.String findDefaultBuiltinAlgorithm()
private CacheManager getPermissionsCache() throws StandardException
StandardException
protected void setDependencyManager()
public DependencyManager getDependencyManager()
getDependencyManager
in interface DataDictionary
DataDictionary.getDependencyManager()
public void stop()
stop
in interface ModuleControl
Monitor
,
ModuleFactory
public Cacheable newCacheable(CacheManager cm)
newCacheable
in interface CacheableFactory
public int startReading(LanguageConnectionContext lcc) throws StandardException
DataDictionary
startReading
in interface DataDictionary
lcc
- The LanguageConnectionContext to use.
StandardException
- Thrown on errorDataDictionary.startReading(org.apache.derby.iapi.sql.conn.LanguageConnectionContext)
public void doneReading(int mode, LanguageConnectionContext lcc) throws StandardException
DataDictionary
doneReading
in interface DataDictionary
mode
- The mode that was returned by startReading().lcc
- The LanguageConnectionContext to use.
StandardException
- Thrown on errorpublic void startWriting(LanguageConnectionContext lcc) throws StandardException
DataDictionary
startWriting
in interface DataDictionary
lcc
- The LanguageConnectionContext to use.
StandardException
- Thrown on errorpublic void transactionFinished() throws StandardException
DataDictionary
transactionFinished
in interface DataDictionary
StandardException
- Thrown on errorpublic int getCacheMode()
DataDictionary
getCacheMode
in interface DataDictionary
private void setCacheMode(int newMode)
public DataDescriptorGenerator getDataDescriptorGenerator()
getDataDescriptorGenerator
in interface DataDictionary
public java.lang.String getAuthorizationDatabaseOwner()
getAuthorizationDatabaseOwner
in interface DataDictionary
public boolean usesSqlAuthorization()
DataDictionary
usesSqlAuthorization
in interface DataDictionary
DataDictionary.usesSqlAuthorization()
public int getCollationTypeOfSystemSchemas()
DataDictionary
getCollationTypeOfSystemSchemas
in interface DataDictionary
DataDictionary.getCollationTypeOfSystemSchemas()
public int getCollationTypeOfUserSchemas()
DataDictionary
getCollationTypeOfUserSchemas
in interface DataDictionary
DataDictionary.getCollationTypeOfUserSchemas()
public DataValueFactory getDataValueFactory()
getDataValueFactory
in interface DataDictionary
public ExecutionFactory getExecutionFactory()
getExecutionFactory
in interface DataDictionary
private void getBuiltinSystemSchemas()
public SchemaDescriptor getSystemSchemaDescriptor() throws StandardException
getSystemSchemaDescriptor
in interface DataDictionary
StandardException
- Thrown on failurepublic SchemaDescriptor getSystemUtilSchemaDescriptor() throws StandardException
StandardException
- Thrown on failurepublic SchemaDescriptor getSysIBMSchemaDescriptor() throws StandardException
getSysIBMSchemaDescriptor
in interface DataDictionary
StandardException
- Thrown on failurepublic SchemaDescriptor getDeclaredGlobalTemporaryTablesSchemaDescriptor() throws StandardException
getDeclaredGlobalTemporaryTablesSchemaDescriptor
in interface DataDictionary
StandardException
- Thrown on failurepublic boolean isSystemSchemaName(java.lang.String name) throws StandardException
isSystemSchemaName
in interface DataDictionary
name
-
StandardException
- Thrown on failurepublic SchemaDescriptor getSchemaDescriptor(java.lang.String schemaName, TransactionController tc, boolean raiseError) throws StandardException
getSchemaDescriptor
in interface DataDictionary
schemaName
- The name of the schema we're interested in. Must not be null.tc
- TransactionControllerraiseError
- whether an exception should be thrown if the schema does not exist.
StandardException
- Thrown on errorprivate SchemaDescriptor locateSchemaRow(UUID schemaId, TransactionController tc) throws StandardException
schemaId
- The id of the schema we're interested in.
If non-null, overrides schemaNametc
- TransactionController. If null, one
is gotten off of the language connection context.
StandardException
- Thrown on errorprivate SchemaDescriptor locateSchemaRow(UUID schemaId, int isolationLevel, TransactionController tc) throws StandardException
schemaId
- The id of the schema we're interested in.
If non-null, overrides schemaNameisolationLevel
- Use this explicit isolation level. Only
ISOLATION_REPEATABLE_READ (normal usage) or
ISOLATION_READ_UNCOMMITTED (corner cases)
supported for now.tc
- TransactionController. If null, one
is gotten off of the language connection context.
StandardException
- Thrown on errorprivate SchemaDescriptor locateSchemaRowBody(UUID schemaId, int isolationLevel, TransactionController tc) throws StandardException
StandardException
private SchemaDescriptor locateSchemaRow(java.lang.String schemaName, TransactionController tc) throws StandardException
schemaName
- The name of the schema we're interested in.
If schemaId is null, used to qual.tc
- TransactionController. If null, one
is gotten off of the language connection context.
StandardException
- Thrown on errorpublic SchemaDescriptor getSchemaDescriptor(UUID schemaId, TransactionController tc) throws StandardException
getSchemaDescriptor
in interface DataDictionary
schemaId
- The id of the schema we're interested in.tc
- The transaction controller to us when scanning
SYSSCHEMAS
StandardException
- Thrown on failurepublic SchemaDescriptor getSchemaDescriptor(UUID schemaId, int isolationLevel, TransactionController tc) throws StandardException
getSchemaDescriptor
in interface DataDictionary
schemaId
- the uuid of the schema we want a descriptor forisolationLevel
- use this explicit isolation level. Only
ISOLATION_REPEATABLE_READ (normal usage) or
ISOLATION_READ_UNCOMMITTED (corner cases)
supported for now.tc
- transaction controller
StandardException
- thrown on errorprivate SchemaDescriptor getSchemaDescriptorBody(UUID schemaId, int isolationLevel, TransactionController tc) throws StandardException
StandardException
public boolean existsSchemaOwnedBy(java.lang.String authid, TransactionController tc) throws StandardException
existsSchemaOwnedBy
in interface DataDictionary
authid
- authorizationIdtc
- TransactionController
StandardException
public void addDescriptor(TupleDescriptor td, TupleDescriptor parent, int catalogNumber, boolean duplicatesAllowed, TransactionController tc) throws StandardException
DataDictionary
addDescriptor
in interface DataDictionary
td
- descriptor to insert.parent
- parent descriptor; e.g for a column parent is the
tabledescriptor to which the descriptor is beign inserted. for most other
objects it is the schema descriptor.catalogNumber
- a value which identifies the catalog into which
the descriptor should be inserted. It is the users responsibility to
ensure that the catalogNumber is consistent with the tuple being
inserted.duplicatesAllowed
- whether an exception should be thrown if the
insert results in a duplicate; if this parameter is FALSE then one
of the following exception will be thrown; LANG_OBJECT_ALREADY_EXISTS (if
parent is null) or LANG_OBJECT_ALREADY_EXISTS_IN_OBJECT (if parent is not
null). The error message is created by getting the name and type of the
tuple and parent.tc
- the transaction controller to use to do all of this.
StandardException
DataDictionary.addDescriptor(org.apache.derby.iapi.sql.dictionary.TupleDescriptor, org.apache.derby.iapi.sql.dictionary.TupleDescriptor, int, boolean, org.apache.derby.iapi.store.access.TransactionController)
private StandardException duplicateDescriptorException(TupleDescriptor tuple, TupleDescriptor parent)
public void addDescriptorArray(TupleDescriptor[] td, TupleDescriptor parent, int catalogNumber, boolean allowDuplicates, TransactionController tc) throws StandardException
addDescriptorArray
in interface DataDictionary
StandardException
DataDictionary.addDescriptor(org.apache.derby.iapi.sql.dictionary.TupleDescriptor, org.apache.derby.iapi.sql.dictionary.TupleDescriptor, int, boolean, org.apache.derby.iapi.store.access.TransactionController)
public void dropRoleGrant(java.lang.String roleName, java.lang.String grantee, java.lang.String grantor, TransactionController tc) throws StandardException
DataDictionary
dropRoleGrant
in interface DataDictionary
roleName
- The name of the role to dropgrantee
- The granteegrantor
- The grantortc
- Transaction Controller
StandardException
- Thrown on failureDataDictionary.dropRoleGrant(java.lang.String, java.lang.String, java.lang.String, org.apache.derby.iapi.store.access.TransactionController)
public void dropSchemaDescriptor(java.lang.String schemaName, TransactionController tc) throws StandardException
dropSchemaDescriptor
in interface DataDictionary
schemaName
- The name of the schema to droptc
- TransactionController for the transaction
StandardException
- Thrown on errorpublic TableDescriptor getTableDescriptor(java.lang.String tableName, SchemaDescriptor schema, TransactionController tc) throws StandardException
getTableDescriptor
in interface DataDictionary
tableName
- The name of the table to get the descriptor forschema
- The descriptor for the schema the table lives in.
If null, use the system schema.tc
- Transaction context.
StandardException
- Thrown on failureprivate TableDescriptor getTableDescriptorIndex1Scan(java.lang.String tableName, java.lang.String schemaUUID) throws StandardException
StandardException
- Thrown on failureTableDescriptor getUncachedTableDescriptor(TableKey tableKey) throws StandardException
tableKey
- The TableKey of the table
StandardException
- Thrown on failurepublic TableDescriptor getTableDescriptor(UUID tableID) throws StandardException
getTableDescriptor
in interface DataDictionary
tableID
- The UUID of the table to get the descriptor for
StandardException
- Thrown on failureprotected TableDescriptor getUncachedTableDescriptor(UUID tableID) throws StandardException
tableID
- The UUID of the table to get the descriptor for
StandardException
- Thrown on failureprivate TableDescriptor getTableDescriptorIndex2Scan(java.lang.String tableUUID) throws StandardException
StandardException
- Thrown on failureprivate TableDescriptor finishTableDescriptor(TableDescriptor td) throws StandardException
td
- The TableDescriptor.
StandardException
- Thrown on failurepublic boolean isSchemaEmpty(SchemaDescriptor sd) throws StandardException
isSchemaEmpty
in interface DataDictionary
sd
- descriptor
StandardException
- on errorprotected boolean isSchemaReferenced(TransactionController tc, TabInfoImpl ti, int indexId, int indexCol, DataValueDescriptor schemaIdOrderable) throws StandardException
tc
- transaction controllerti
- table info for the system tableindexId
- index idindexCol
- 1 based index columnschemaIdOrderable
- the schemaid in a char orderable
StandardException
- on errorpublic void dropTableDescriptor(TableDescriptor td, SchemaDescriptor schema, TransactionController tc) throws StandardException
dropTableDescriptor
in interface DataDictionary
td
- The table descriptor to dropschema
- A descriptor for the schema the table
is a part of. If this parameter is
NULL, then the table is part of the
current (default) schematc
- TransactionController for the transaction
StandardException
- Thrown on errorpublic void updateLockGranularity(TableDescriptor td, SchemaDescriptor schema, char lockGranularity, TransactionController tc) throws StandardException
updateLockGranularity
in interface DataDictionary
td
- The TableDescriptor for the tableschema
- The SchemaDescriptor for the tablelockGranularity
- The new lockGranularitytc
- The TransactionController to use.
StandardException
- Thrown on errorvoid upgradeCLOBGETSUBSTRING_10_6(TransactionController tc) throws StandardException
StandardException
void upgradeSYSROUTINEPERMS_10_6(TransactionController tc) throws StandardException
StandardException
public ColumnDescriptor getColumnDescriptorByDefaultId(UUID uuid) throws StandardException
getColumnDescriptorByDefaultId
in interface DataDictionary
uuid
- The UUID of the default
StandardException
- Thrown on failureprivate void getColumnDescriptorsScan(TableDescriptor td) throws StandardException
td
- The TableDescriptor.
StandardException
- Thrown on failureprivate void getColumnDescriptorsScan(UUID uuid, ColumnDescriptorList cdl, TupleDescriptor td) throws StandardException
uuid
- The referencing UUIDcdl
- The column descriptor listtd
- The parent tuple descriptor
StandardException
- Thrown on failurepublic void dropColumnDescriptor(UUID tableID, java.lang.String columnName, TransactionController tc) throws StandardException
dropColumnDescriptor
in interface DataDictionary
tableID
- The UUID of the table to drop the column fromcolumnName
- The name of the column to droptc
- TransactionController for the transaction
StandardException
- Thrown on errorpublic void dropAllColumnDescriptors(UUID tableID, TransactionController tc) throws StandardException
dropAllColumnDescriptors
in interface DataDictionary
tableID
- The UUID of the table from which to drop
all the column descriptorstc
- TransactionController for the transaction
StandardException
- Thrown on errorpublic void dropAllTableAndColPermDescriptors(UUID tableID, TransactionController tc) throws StandardException
dropAllTableAndColPermDescriptors
in interface DataDictionary
tableID
- The UUID of the table from which to drop
all the permission descriptorstc
- TransactionController for the transaction
StandardException
- Thrown on errorpublic void updateSYSCOLPERMSforAddColumnToUserTable(UUID tableID, TransactionController tc) throws StandardException
updateSYSCOLPERMSforAddColumnToUserTable
in interface DataDictionary
tableID
- The UUID of the table to which a column has been addedtc
- TransactionController for the transaction
StandardException
- Thrown on errorpublic void updateSYSCOLPERMSforDropColumn(UUID tableID, TransactionController tc, ColumnDescriptor columnDescriptor) throws StandardException
updateSYSCOLPERMSforDropColumn
in interface DataDictionary
tableID
- The UUID of the table from which a col has been droppedtc
- TransactionController for the transactioncolumnDescriptor
- Information about the dropped column
StandardException
- Thrown on errorprivate void rewriteSYSCOLPERMSforAlterTable(UUID tableID, TransactionController tc, ColumnDescriptor columnDescriptor) throws StandardException
tableID
- The UUID of the table being alteredtc
- TransactionController for the transactioncolumnDescriptor
- Dropped column info, or null if adding
StandardException
- Thrown on errorprivate void removePermEntryInCache(PermissionsDescriptor perm) throws StandardException
StandardException
public void dropAllRoutinePermDescriptors(UUID routineID, TransactionController tc) throws StandardException
dropAllRoutinePermDescriptors
in interface DataDictionary
routineID
- The UUID of the routine from which to drop
all the permission descriptorstc
- TransactionController for the transaction
StandardException
- Thrown on errorpublic void dropRoleGrantsByGrantee(java.lang.String grantee, TransactionController tc) throws StandardException
DataDictionary
dropRoleGrantsByGrantee
in interface DataDictionary
grantee
- The granteetc
- Transaction Controller
StandardException
- Thrown on failureDataDictionary.dropRoleGrantsByGrantee(java.lang.String, org.apache.derby.iapi.store.access.TransactionController)
private boolean existsRoleGrantByGrantee(java.lang.String grantee, TransactionController tc) throws StandardException
grantee
- authorization identifiertc
- Transaction Controller
StandardException
- Thrown on failurepublic void dropRoleGrantsByName(java.lang.String roleName, TransactionController tc) throws StandardException
DataDictionary
dropRoleGrantsByName
in interface DataDictionary
roleName
- The role name grantedtc
- Transaction Controller
StandardException
- Thrown on failureDataDictionary.dropRoleGrantsByName(java.lang.String, org.apache.derby.iapi.store.access.TransactionController)
private boolean visitRoleGrants(TabInfoImpl ti, SYSROLESRowFactory rf, int columnNo, java.lang.String authId, TransactionController tc, int action) throws StandardException
EXISTS
or
DROP
(to check for existence, or to drop that row).
If the scan proves too slow, we should add more indexes. only.
ti
- TabInfoImpl
for SYSROLES.rf
- row factory for SYSROLEScolumnNo
- the column number to match authId
againsttc
- transaction controlleraction
- drop matching rows (DROP
), or return
true
if there is a matching row
(EXISTS
)
true
if there is a matching row
else return false
.
StandardException
java.util.HashMap getRoleGrantGraph(TransactionController tc, boolean inverse) throws StandardException
tc
- Transaction Controllerinverse
- make graph on inverse grant relation
StandardException
public RoleClosureIterator createRoleClosureIterator(TransactionController tc, java.lang.String role, boolean inverse) throws StandardException
DataDictionary
dd.startReading()
or dd.startWriting()
call.
createRoleClosureIterator
in interface DataDictionary
tc
- transaction controllerrole
- name of starting point for closureinverse
- If true
, compute closure on inverse of
relation GRANT role-a TO role-b that is, we look at
closure of all roles granted role
. If
false
, we look at closure of all roles that have
been granted role
.
StandardException
DataDictionary.createRoleClosureIterator(org.apache.derby.iapi.store.access.TransactionController, java.lang.String, boolean)
public void dropAllPermsByGrantee(java.lang.String authId, TransactionController tc) throws StandardException
dropAllPermsByGrantee
in interface DataDictionary
authId
- The authentication identifiertc
- Transaction Controller
StandardException
- Thrown on failureprivate void dropPermsByGrantee(java.lang.String authId, TransactionController tc, int catalog, int indexNo, int granteeColnoInIndex) throws StandardException
StandardException
private boolean existsPermByGrantee(java.lang.String authId, TransactionController tc, int catalog, int indexNo, int granteeColnoInIndex) throws StandardException
StandardException
private boolean visitPermsByGrantee(java.lang.String authId, TransactionController tc, int catalog, int indexNo, int granteeColnoInIndex, int action) throws StandardException
indexNo
index on a permission table
catalog
, looking for match(es) for the grantee column
(given by granteeColnoInIndex for the catalog in question).
The action argument can be either EXISTS
or
DROP
(to check for existence, or to drop that row).
There is no index on grantee column only on on any of the
permissions tables, so we use the index which contain grantee
and scan that, setting up a scan qualifier to match the
grantee, then fetch the base row.
If this proves too slow, we should add an index on grantee
only.
authId
- grantee to match againsttc
- transaction controllercatalog
- the underlying permission table to visitindexNo
- the number of the index by which to access the cataloggranteeColnoInIndex
- the column number to match
authId
againstaction
- drop matching rows (DROP
), or return
true
if there is a matching row
(EXISTS
)
true
if there is a matching row
else return false
.
StandardException
private void dropColumnDescriptorCore(TransactionController tc, ExecIndexRow keyRow) throws StandardException
tc
- The TransactionControllerkeyRow
- Start/stop position.
StandardException
- Thrown on failureprivate void dropTablePermDescriptor(TransactionController tc, ExecIndexRow keyRow) throws StandardException
tc
- The TransactionControllerkeyRow
- Start/stop position.
StandardException
- Thrown on failureprivate void dropColumnPermDescriptor(TransactionController tc, ExecIndexRow keyRow) throws StandardException
tc
- The TransactionControllerkeyRow
- Start/stop position.
StandardException
- Thrown on failureprivate void updateColumnDescriptor(ColumnDescriptor cd, UUID formerUUID, java.lang.String formerName, int[] colsToSet, TransactionController tc) throws StandardException
cd
- The ColumnDescriptorformerUUID
- The UUID for this column in SYSCOLUMNS,
may differ from what is in cd if this
is the column that is being set.formerName
- The name for this column in SYSCOLUMNS
may differ from what is in cd if this
is the column that is being set.colsToSet
- Array of ints of columns to be modified,
1 based. May be null (all cols).tc
- The TransactionController to use
StandardException
- Thrown on failurepublic ViewDescriptor getViewDescriptor(UUID uuid) throws StandardException
getViewDescriptor
in interface DataDictionary
uuid
- The UUID for the view
StandardException
- Thrown on errorpublic ViewDescriptor getViewDescriptor(TableDescriptor td) throws StandardException
getViewDescriptor
in interface DataDictionary
td
- The TableDescriptor for the view.
StandardException
- Thrown on errorprivate ViewDescriptor getViewDescriptorScan(TableDescriptor tdi) throws StandardException
tdi
- The TableDescriptor for the view.
StandardException
- Thrown on errorpublic void dropViewDescriptor(ViewDescriptor vd, TransactionController tc) throws StandardException
dropViewDescriptor
in interface DataDictionary
vd
- A descriptor for the view to be droppedtc
- TransactionController to use
StandardException
- Thrown on errorprivate FileInfoDescriptor getFileInfoDescriptorIndex2Scan(UUID id) throws StandardException
StandardException
- Thrown on failurepublic FileInfoDescriptor getFileInfoDescriptor(UUID id) throws StandardException
DataDictionary
getFileInfoDescriptor
in interface DataDictionary
id
- The descriptor's id.
StandardException
- Thrown on failureDataDictionary.getFileInfoDescriptor(org.apache.derby.catalog.UUID)
private FileInfoDescriptor getFileInfoDescriptorIndex1Scan(UUID schemaId, java.lang.String name) throws StandardException
StandardException
- Thrown on failurepublic FileInfoDescriptor getFileInfoDescriptor(SchemaDescriptor sd, java.lang.String name) throws StandardException
DataDictionary
getFileInfoDescriptor
in interface DataDictionary
sd
- the schema that holds the FileInfoDescriptor.name
- SQL name of file.
StandardException
- Thrown on failureDataDictionary.getFileInfoDescriptor(org.apache.derby.catalog.UUID)
public void dropFileInfoDescriptor(FileInfoDescriptor fid) throws StandardException
DataDictionary
dropFileInfoDescriptor
in interface DataDictionary
StandardException
- Thrown on errorDataDictionary.dropFileInfoDescriptor(org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor)
public SPSDescriptor getSPSDescriptor(UUID uuid) throws StandardException
getSPSDescriptor
in interface DataDictionary
uuid
- The UUID
StandardException
- Thrown on failurevoid spsCacheEntryAdded(SPSDescriptor spsd)
void spsCacheEntryRemoved(SPSDescriptor spsd)
public SPSDescriptor getUncachedSPSDescriptor(TableKey stmtKey) throws StandardException
stmtKey
- The TableKey of the sps
StandardException
- Thrown on failureprotected SPSDescriptor getUncachedSPSDescriptor(UUID stmtId) throws StandardException
stmtId
- The UUID of the stmt to get the descriptor for
StandardException
- Thrown on failureprivate SPSDescriptor getSPSDescriptorIndex2Scan(java.lang.String stmtUUID) throws StandardException
StandardException
- Thrown on failurepublic SPSDescriptor getSPSDescriptor(java.lang.String stmtName, SchemaDescriptor sd) throws StandardException
getSPSDescriptor
in interface DataDictionary
stmtName
- the statement namesd
- The SchemaDescriptor
StandardException
- Thrown on failureprivate SPSDescriptor getSPSDescriptorIndex1Scan(java.lang.String stmtName, java.lang.String schemaUUID) throws StandardException
StandardException
- Thrown on failurepublic void addSPSDescriptor(SPSDescriptor descriptor, TransactionController tc) throws StandardException
addSPSDescriptor
in interface DataDictionary
descriptor
- The descriptor to addtc
- The transaction controller
StandardException
- Thrown on errorprivate void addSPSParams(SPSDescriptor spsd, TransactionController tc) throws StandardException
StandardException
public DataTypeDescriptor[] getSPSParams(SPSDescriptor spsd, java.util.Vector defaults) throws StandardException
getSPSParams
in interface DataDictionary
spsd
- sps descriptordefaults
- vector for storing column defaults
StandardException
- Thrown on errorpublic void updateSPS(SPSDescriptor spsd, TransactionController tc, boolean recompile, boolean updateParamDescriptors, boolean firstCompilation) throws StandardException
updateSPS
in interface DataDictionary
spsd
- The descriptor to addtc
- The transaction controllerupdateParamDescriptors
- If true, will update the
parameter descriptors in SYS.SYSCOLUMNS.firstCompilation
- true, if Statement is getting compiled for first
time and SPS was created with NOCOMPILE option.recompile
- whether to recompile or invalidate
StandardException
- Thrown on errorpublic void invalidateAllSPSPlans() throws StandardException
DataDictionary
invalidateAllSPSPlans
in interface DataDictionary
StandardException
- Thrown on errorDataDictionary.invalidateAllSPSPlans()
void clearSPSPlans() throws StandardException
StandardException
- Thrown on errorpublic void dropSPSDescriptor(SPSDescriptor descriptor, TransactionController tc) throws StandardException
dropSPSDescriptor
in interface DataDictionary
descriptor
- The descriptor to droptc
- The TransactionController.
StandardException
- Thrown on failurepublic void dropSPSDescriptor(UUID uuid, TransactionController tc) throws StandardException
dropSPSDescriptor
in interface DataDictionary
uuid
- the statement uuidtc
- The TransactionController.
StandardException
- Thrown on failurepublic java.util.List getAllSPSDescriptors() throws StandardException
getAllSPSDescriptors
in interface DataDictionary
StandardException
- Thrown on failureprivate ConstraintDescriptorList getAllConstraintDescriptors() throws StandardException
StandardException
- Thrown on failureprivate GenericDescriptorList getAllTriggerDescriptors() throws StandardException
StandardException
- Thrown on failurepublic TriggerDescriptor getTriggerDescriptor(UUID uuid) throws StandardException
getTriggerDescriptor
in interface DataDictionary
uuid
- The UUID
StandardException
- Thrown on failurepublic TriggerDescriptor getTriggerDescriptor(java.lang.String name, SchemaDescriptor sd) throws StandardException
getTriggerDescriptor
in interface DataDictionary
name
- The sps name.sd
- The schema descriptor.
StandardException
- Thrown on failurepublic GenericDescriptorList getTriggerDescriptors(TableDescriptor td) throws StandardException
getTriggerDescriptors
in interface DataDictionary
td
- The table descriptor.
StandardException
- Thrown on failureprivate void getTriggerDescriptorsScan(TableDescriptor td, boolean forUpdate) throws StandardException
td
- The TableDescriptor.forUpdate
- Whether or not to open scan for update
StandardException
- Thrown on failurepublic void dropTriggerDescriptor(TriggerDescriptor descriptor, TransactionController tc) throws StandardException
dropTriggerDescriptor
in interface DataDictionary
descriptor
- The descriptor to droptc
- The TransactionController.
StandardException
- Thrown on failurepublic void updateTriggerDescriptor(TriggerDescriptor triggerd, UUID formerUUID, int[] colsToSet, TransactionController tc) throws StandardException
updateTriggerDescriptor
in interface DataDictionary
triggerd
- The Trigger descriptorformerUUID
- The UUID for this column in SYSTRIGGERS,
may differ from what is in triggerd if this
is the column that is being set.colsToSet
- Array of ints of columns to be modified,
1 based. May be null (all cols).tc
- The TransactionController to use
StandardException
- Thrown on failurepublic ConstraintDescriptor getConstraintDescriptor(UUID uuid) throws StandardException
getConstraintDescriptor
in interface DataDictionary
uuid
- The UUID
StandardException
- Thrown on failurepublic ConstraintDescriptor getConstraintDescriptor(java.lang.String constraintName, UUID schemaID) throws StandardException
getConstraintDescriptor
in interface DataDictionary
constraintName
- Constraint name.schemaID
- The schema UUID
StandardException
- Thrown on failurepublic java.util.List getStatisticsDescriptors(TableDescriptor td) throws StandardException
getStatisticsDescriptors
in interface DataDictionary
td
- Table Descriptor for which I need statistics
StandardException
public ConstraintDescriptorList getConstraintDescriptors(TableDescriptor td) throws StandardException
getConstraintDescriptors
in interface DataDictionary
td
- The table descriptor. If null,
all constraint descriptors are returned.
StandardException
- Thrown on failurepublic ConstraintDescriptorList getActiveConstraintDescriptors(ConstraintDescriptorList cdl) throws StandardException
getActiveConstraintDescriptors
in interface DataDictionary
cdl
- The constraint descriptor list to wrap with
an Active constraint descriptor list.
StandardException
- Thrown on failurepublic boolean activeConstraint(ConstraintDescriptor constraint) throws StandardException
activeConstraint
in interface DataDictionary
constraint
- the constraint to check
StandardException
- Thrown on failurepublic ConstraintDescriptor getConstraintDescriptor(TableDescriptor td, UUID uuid) throws StandardException
getConstraintDescriptor
in interface DataDictionary
td
- The table descriptor.uuid
- the UUID for the backing index.
StandardException
- Thrown on failurepublic ConstraintDescriptor getConstraintDescriptorById(TableDescriptor td, UUID uuid) throws StandardException
getConstraintDescriptorById
in interface DataDictionary
td
- The table descriptor.uuid
- The UUID for the constraint
StandardException
- Thrown on failurepublic ConstraintDescriptor getConstraintDescriptorByName(TableDescriptor td, SchemaDescriptor sd, java.lang.String constraintName, boolean forUpdate) throws StandardException
getConstraintDescriptorByName
in interface DataDictionary
td
- The table descriptor.sd
- The schema descriptor for the constraintconstraintName
- The constraint name.forUpdate
- Whether or not access is for update
StandardException
- Thrown on failureprivate void getConstraintDescriptorsScan(TableDescriptor td, boolean forUpdate) throws StandardException
td
- The TableDescriptor.forUpdate
- Whether or not to open scan for update
StandardException
- Thrown on failureprotected ConstraintDescriptor getConstraintDescriptorViaIndex(int indexId, ExecIndexRow keyRow, TabInfoImpl ti, TableDescriptor td, ConstraintDescriptorList dList, boolean forUpdate) throws StandardException
indexId
- The id of the index (0 to # of indexes on table) to usekeyRow
- The supplied ExecIndexRow for searchti
- The TabInfoImpl to usetd
- The TableDescriptor, if supplied.dList
- The list to build, if supplied. If null, then caller expects
a single descriptorforUpdate
- Whether or not to open scan for update
StandardException
- Thrown on errorprotected TupleDescriptor getConstraintDescriptorViaHeap(ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, java.util.List list) throws StandardException
scanQualifiers
- qualifiersti
- The TabInfoImpl to useparentTupleDescriptor
- The parentDescriptor, if applicable.list
- The list to build, if supplied.
If null, then caller expects a single descriptor
StandardException
- Thrown on errorpublic TableDescriptor getConstraintTableDescriptor(UUID constraintId) throws StandardException
getConstraintTableDescriptor
in interface DataDictionary
constraintId
- The id of the constraint
StandardException
- Thrown on errorpublic ConstraintDescriptorList getForeignKeys(UUID constraintId) throws StandardException
getForeignKeys
in interface DataDictionary
constraintId
- The id of the referenced constraint
StandardException
- Thrown on errorpublic java.util.List getConstraints(UUID uuid, int indexId, int columnNum) throws StandardException
uuid
- The id of the constraintindexId
- The index id in SYS.SYSCONSTRAINTScolumnNum
- The column to retrieve
StandardException
- Thrown on errorpublic void addConstraintDescriptor(ConstraintDescriptor descriptor, TransactionController tc) throws StandardException
addConstraintDescriptor
in interface DataDictionary
descriptor
- The descriptor to addtc
- The transaction controller
StandardException
- Thrown on errorpublic void updateConstraintDescriptor(ConstraintDescriptor cd, UUID formerUUID, int[] colsToSet, TransactionController tc) throws StandardException
updateConstraintDescriptor
in interface DataDictionary
cd
- The ConstraintescriptorformerUUID
- The UUID for this column in SYSCONSTRAINTS,
may differ from what is in cd if this
is the column that is being set.colsToSet
- Array of ints of columns to be modified,
1 based. May be null (all cols).tc
- The TransactionController to use
StandardException
- Thrown on failurepublic void dropConstraintDescriptor(ConstraintDescriptor descriptor, TransactionController tc) throws StandardException
dropConstraintDescriptor
in interface DataDictionary
descriptor
- The descriptor to droptc
- The TransactionController
StandardException
- Thrown on errorpublic void dropAllConstraintDescriptors(TableDescriptor table, TransactionController tc) throws StandardException
dropAllConstraintDescriptors
in interface DataDictionary
table
- The table from which to drop all
constraint descriptorstc
- The TransactionController
StandardException
- Thrown on errorpublic SubKeyConstraintDescriptor getSubKeyConstraint(UUID constraintId, int type) throws StandardException
getSubKeyConstraint
in interface DataDictionary
constraintId
- The UUID for the constraint.type
- The type of the constraint
(e.g. DataDictionary.FOREIGNKEY_CONSTRAINT)
StandardException
- Thrown on failureprivate void addSubKeyConstraint(KeyConstraintDescriptor descriptor, TransactionController tc) throws StandardException
descriptor
- The KeyConstraintDescriptor for the constraint.tc
- The TransactionController
StandardException
- Thrown on failureprivate void dropSubKeyConstraint(ConstraintDescriptor constraint, TransactionController tc) throws StandardException
constraint
- the constrainttc
- The TransactionController
StandardException
- Thrown on failureprivate SubCheckConstraintDescriptor getSubCheckConstraint(UUID constraintId) throws StandardException
constraintId
- The UUID for the constraint.
StandardException
- Thrown on failureprivate void dropSubCheckConstraint(UUID constraintId, TransactionController tc) throws StandardException
constraintId
- The constraint id.tc
- The TransactionController
StandardException
- Thrown on failurepublic java.util.Hashtable hashAllConglomerateDescriptorsByNumber(TransactionController tc) throws StandardException
hashAllConglomerateDescriptorsByNumber
in interface DataDictionary
tc
- TransactionController for the transaction
StandardException
- Thrown on failurepublic java.util.Hashtable hashAllTableDescriptorsByTableId(TransactionController tc) throws StandardException
hashAllTableDescriptorsByTableId
in interface DataDictionary
tc
- TransactionController for the transaction
StandardException
- Thrown on failurepublic ConglomerateDescriptor getConglomerateDescriptor(UUID uuid) throws StandardException
getConglomerateDescriptor
in interface DataDictionary
uuid
- The UUID
StandardException
- Thrown on failurepublic ConglomerateDescriptor[] getConglomerateDescriptors(UUID uuid) throws StandardException
getConglomerateDescriptors
in interface DataDictionary
uuid
- The UUID
StandardException
- Thrown on failurepublic ConglomerateDescriptor getConglomerateDescriptor(long conglomerateNumber) throws StandardException
getConglomerateDescriptor
in interface DataDictionary
conglomerateNumber
- The conglomerate number.
StandardException
- Thrown on failurepublic ConglomerateDescriptor[] getConglomerateDescriptors(long conglomerateNumber) throws StandardException
getConglomerateDescriptors
in interface DataDictionary
conglomerateNumber
- The number for the conglomerate
we're interested in
StandardException
- Thrown on failureprivate void getConglomerateDescriptorsScan(TableDescriptor td) throws StandardException
td
- The TableDescriptor.
StandardException
- Thrown on failurepublic ConglomerateDescriptor getConglomerateDescriptor(java.lang.String indexName, SchemaDescriptor sd, boolean forUpdate) throws StandardException
getConglomerateDescriptor
in interface DataDictionary
indexName
- The name of the index we're looking forsd
- The schema descriptorforUpdate
- Whether or not to get an exclusive row
lock on the row in sys.sysconglomerates.
StandardException
- Thrown on failurepublic void dropConglomerateDescriptor(ConglomerateDescriptor conglomerate, TransactionController tc) throws StandardException
dropConglomerateDescriptor
in interface DataDictionary
conglomerate
- The ConglomerateDescriptor for the conglomeratetc
- TransactionController for the transaction
StandardException
- Thrown on failurepublic void dropAllConglomerateDescriptors(TableDescriptor td, TransactionController tc) throws StandardException
dropAllConglomerateDescriptors
in interface DataDictionary
td
- The TableDescriptor of the tabletc
- TransactionController for the transaction
StandardException
- Thrown on failurepublic void updateConglomerateDescriptor(ConglomerateDescriptor cd, long conglomerateNumber, TransactionController tc) throws StandardException
updateConglomerateDescriptor
in interface DataDictionary
cd
- The ConglomerateDescriptorconglomerateNumber
- The new conglomerate numbertc
- The TransactionController to use
StandardException
- Thrown on failurepublic void updateSystemSchemaAuthorization(java.lang.String aid, TransactionController tc) throws StandardException
aid
- AuthorizationID of Database Ownertc
- TransactionController to use
StandardException
- Thrown on failurepublic void updateSchemaAuth(java.lang.String schemaName, java.lang.String authorizationId, TransactionController tc) throws StandardException
schemaName
- Schema Name of system schemaauthorizationId
- authorizationId of new schema ownertc
- The TransactionController to use
StandardException
- Thrown on failurepublic void updateConglomerateDescriptor(ConglomerateDescriptor[] cds, long conglomerateNumber, TransactionController tc) throws StandardException
updateConglomerateDescriptor
in interface DataDictionary
cds
- The array of ConglomerateDescriptorsconglomerateNumber
- The new conglomerate numbertc
- The TransactionController to use
StandardException
- Thrown on failurepublic java.util.List getDependentsDescriptorList(java.lang.String dependentID) throws StandardException
getDependentsDescriptorList
in interface DataDictionary
dependentID
- The ID of the dependent we're interested in
StandardException
- Thrown on failurepublic java.util.List getProvidersDescriptorList(java.lang.String providerID) throws StandardException
getProvidersDescriptorList
in interface DataDictionary
providerID
- The ID of the provider we're interested in
StandardException
- Thrown on failurepublic java.util.List getAllDependencyDescriptorsList() throws StandardException
getAllDependencyDescriptorsList
in interface DataDictionary
StandardException
- Thrown on failurepublic void dropStoredDependency(DependencyDescriptor dd, TransactionController tc) throws StandardException
dropStoredDependency
in interface DataDictionary
dd
- The DependencyDescriptor.tc
- TransactionController for the transaction
StandardException
- Thrown on failurepublic void dropDependentsStoredDependencies(UUID dependentsUUID, TransactionController tc) throws StandardException
dropDependentsStoredDependencies
in interface DataDictionary
dependentsUUID
- Dependent's uuidtc
- TransactionController for the transaction
StandardException
- Thrown on failurepublic void dropDependentsStoredDependencies(UUID dependentsUUID, TransactionController tc, boolean wait) throws StandardException
DataDictionary
dropDependentsStoredDependencies
in interface DataDictionary
dependentsUUID
- Dependent's uuidtc
- TransactionController for the transactionwait
- If true, then the caller wants to wait for locks. False will
be when we using a nested user xaction - we want to timeout
right away if the parent holds the lock.
StandardException
- Thrown on failurepublic UUIDFactory getUUIDFactory()
getUUIDFactory
in interface DataDictionary
public AliasDescriptor getAliasDescriptorForUDT(TransactionController tc, DataTypeDescriptor dtd) throws StandardException
getAliasDescriptorForUDT
in interface DataDictionary
tc
- The transaction to use: if null, use the compilation transactiondtd
- The UDT's type descriptor
StandardException
public AliasDescriptor getAliasDescriptor(UUID uuid) throws StandardException
getAliasDescriptor
in interface DataDictionary
uuid
- The UUID
StandardException
- Thrown on failurepublic AliasDescriptor getAliasDescriptor(java.lang.String schemaId, java.lang.String aliasName, char nameSpace) throws StandardException
getAliasDescriptor
in interface DataDictionary
schemaId
- schema identifieraliasName
- The alias name.nameSpace
- The alias type.
StandardException
- Thrown on failurepublic java.util.List getRoutineList(java.lang.String schemaID, java.lang.String routineName, char nameSpace) throws StandardException
getRoutineList
in interface DataDictionary
StandardException
public void dropAliasDescriptor(AliasDescriptor ad, TransactionController tc) throws StandardException
dropAliasDescriptor
in interface DataDictionary
ad
- The AliasDescriptor to droptc
- The TransactionController
StandardException
- Thrown on failureprotected void loadDictionaryTables(TransactionController tc, DataDescriptorGenerator ddg, java.util.Properties startParams) throws StandardException
tc
- TransactionControllerddg
- DataDescriptorGenerator
StandardException
- Thrown on errorpublic void resetDatabaseOwner(TransactionController tc) throws StandardException
tc
- TransactionController
StandardException
- Thrown on errorpublic void loadCatalogs(DataDescriptorGenerator ddg, TabInfoImpl[] catalogArray) throws StandardException
ddg
- DataDescriptorGenerator
StandardException
- Thrown on errorprotected void createDictionaryTables(java.util.Properties params, TransactionController tc, DataDescriptorGenerator ddg) throws StandardException
protected Configuration createDictionaryTables(Configuration cfg, TransactionController tc, DataDescriptorGenerator ddg) throws StandardException { super.createDictionaryTables(params, tc, ddg); ... }
StandardException
- Standard Derby error policyprivate SchemaDescriptor addSystemSchema(java.lang.String schema_name, java.lang.String schema_uuid, TransactionController tc) throws StandardException
schema_name
- name of the schema to add.
StandardException
- Standard exception policy.protected void upgradeMakeCatalog(TransactionController tc, int catalogNumber) throws StandardException
tc
- TransactionController to use.catalogNumber
- catalogNumber
StandardException
public void makeCatalog(TabInfoImpl ti, SchemaDescriptor sd, TransactionController tc) throws StandardException
ti
- TabInfoImpl describing catalog to create.sd
- Schema to create catalogs in.tc
- Transaction context.
StandardException
- Standard Derby error policypublic void upgradeFixSystemColumnDefinition(CatalogRowFactory rowFactory, int columnNumber, TransactionController tc) throws StandardException
columnNumber
- The column to changetc
- Transaction controller
StandardException
- Standard Derby error policypublic void upgrade_addColumns(CatalogRowFactory rowFactory, int[] newColumnIDs, TransactionController tc) throws StandardException
rowFactory
- Associated with this catalog.newColumnIDs
- Array of 1-based column ids.tc
- Transaction controller
StandardException
- Standard Derby error policypublic void upgrade_addInvisibleColumns(CatalogRowFactory rowFactory, int[] newColumnIDs, TransactionController tc) throws StandardException
rowFactory
- Associated with this catalog.newColumnIDs
- Array of 1-based column ids.tc
- Transaction controller
StandardException
- Standard Derby error policyprivate void widenConglomerate(ExecRow templateRow, int[] newColumnIDs, long conglomID, TransactionController tc) throws StandardException
templateRow
- Ultimate shape of base row of tablenewColumnIDs
- Array of 1-based column idsconglomID
- heap idtc
- Transaction controller
StandardException
- Standard Derby error policypublic long upgrade_makeOneIndex(TransactionController tc, TabInfoImpl ti, int indexNumber, long heapConglomerateNumber) throws StandardException
tc
- transaction controllerti
- information on the catalog that's having a new index addedindexNumber
- 0-based index numberheapConglomerateNumber
- what it is
StandardException
- Thrown on failureprivate UUID getUUIDForCoreTable(java.lang.String tableName, java.lang.String schemaUUID, TransactionController tc) throws StandardException
tableName
- Name of the tableschemaUUID
- UUID of schematc
- TransactionController to user
StandardException
- Thrown on failurevoid upgrade_initSystemTableCols(TransactionController tc, boolean isCoreTable, int tableNum, FormatableBitSet columnsToUpdateSet, DataValueDescriptor[] replaceRow) throws StandardException
tc
- The TransactionController for the transaction to do the
upgrade in.isCoreTable
- true if it is a core tabletableNum
- the noncore table numbercolumnsToUpdateSet
- a bit set of columns to update. ZERO BASEDreplaceRow
- an object array of Orderables for the new values
StandardException
- Thrown on errorprivate void bootStrapSystemIndexes(SchemaDescriptor sd, TransactionController tc, DataDescriptorGenerator ddg, TabInfoImpl ti) throws StandardException
StandardException
- Standard Derby error policypublic RowLocation[] computeAutoincRowLocations(TransactionController tc, TableDescriptor td) throws StandardException
DataDictionary
computeAutoincRowLocations
in interface DataDictionary
tc
- TransactionControler to use to compute the row location.td
- TableDescriptor
StandardException
DataDictionary.computeAutoincRowLocations(org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.iapi.sql.dictionary.TableDescriptor)
public NumberDataValue getSetAutoincrementValue(RowLocation rl, TransactionController tc, boolean doUpdate, NumberDataValue newValue, boolean wait) throws StandardException
DataDictionary
getSetAutoincrementValue
in interface DataDictionary
rl
- RowLocation of the entry in SYSCOLUMNS.tc
- TransactionController to use.doUpdate
- Write the new value to disk if TRUE.newValue
- A NumberDataValue to use to return incremented value. If
null, then the caller simply wants the current value fromd disk.wait
- If true, then the caller wants to wait for locks. When
using a nested user xaction we want to timeout right away if the parent
holds the lock.
StandardException
DataDictionary.getSetAutoincrementValue(org.apache.derby.iapi.types.RowLocation, org.apache.derby.iapi.store.access.TransactionController, boolean, org.apache.derby.iapi.types.NumberDataValue, boolean)
private ConglomerateDescriptor bootstrapOneIndex(SchemaDescriptor sd, TransactionController tc, DataDescriptorGenerator ddg, TabInfoImpl ti, int indexNumber, long heapConglomerateNumber) throws StandardException
StandardException
public void initSystemIndexVariables(DataDescriptorGenerator ddg, TabInfoImpl ti, int indexNumber) throws StandardException
StandardException
protected void populateSYSDUMMY1(TransactionController tc) throws StandardException
StandardException
- Standard Derby error policypublic void clearCaches() throws StandardException
clearCaches
in interface DataDictionary
StandardException
- Standard Derby error policyprivate void addSystemTableToDictionary(TabInfoImpl ti, SchemaDescriptor sd, TransactionController tc, DataDescriptorGenerator ddg) throws StandardException
StandardException
private ColumnDescriptor makeColumnDescriptor(SystemColumn column, int columnPosition, TableDescriptor td) throws StandardException
column
- a SystemColumncolumnPosition
- Position of the column in the table, one based.td
- descriptor for table that column lives in
StandardException
- Standard Derby error policyprivate long createConglomerate(java.lang.String name, TransactionController tc, ExecRow rowTemplate, java.util.Properties properties) throws StandardException
name
- Name of new catalog.tc
- Transaction context.rowTemplate
- Template for rows for the new tableproperties
- Properties for createConglomerate
StandardException
- Standard Derby error policy.private static SQLChar getIDValueAsCHAR(UUID uuid)
public void initializeCatalogInfo() throws StandardException
StandardException
- Thrown on errorprivate void initializeCoreInfo() throws StandardException
StandardException
private void initializeNoncoreInfo() throws StandardException
StandardException
public TransactionController getTransactionCompile() throws StandardException
StandardException
- Thrown on errorpublic TransactionController getTransactionExecute() throws StandardException
StandardException
- Thrown on errorprivate final TupleDescriptor getDescriptorViaIndex(int indexId, ExecIndexRow keyRow, ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, java.util.List list, boolean forUpdate) throws StandardException
indexId
- The id of the index (0 to # of indexes on table) to usekeyRow
- The supplied ExecIndexRow for searchti
- The TabInfoImpl to useparentTupleDescriptor
- The parentDescriptor, if applicable.list
- The list to build, if supplied. If null, then
caller expects a single descriptorforUpdate
- Whether or not to open the index for update.
StandardException
- Thrown on errorprivate final TupleDescriptor getDescriptorViaIndex(int indexId, ExecIndexRow keyRow, ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, java.util.List list, boolean forUpdate, TransactionController tc) throws StandardException
indexId
- The id of the index (0 to # of indexes on table) to usekeyRow
- The supplied ExecIndexRow for searchti
- The TabInfoImpl to useparentTupleDescriptor
- The parentDescriptor, if applicable.list
- The list to build, if supplied. If null, then
caller expects a single descriptorforUpdate
- Whether or not to open the index for update.tc
- Transaction controller
StandardException
- Thrown on errorprivate final TupleDescriptor getDescriptorViaIndex(int indexId, ExecIndexRow keyRow, ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, java.util.List list, boolean forUpdate, int isolationLevel, TransactionController tc) throws StandardException
indexId
- The id of the index (0 to # of indexes on table) to usekeyRow
- The supplied ExecIndexRow for searchti
- The TabInfoImpl to useparentTupleDescriptor
- The parentDescriptor, if applicable.list
- The list to build, if supplied. If null, then
caller expects a single descriptorforUpdate
- Whether or not to open the index for update.isolationLevel
- Use this explicit isolation level. Only
ISOLATION_REPEATABLE_READ (normal usage) or
ISOLATION_READ_UNCOMMITTED (corner cases)
supported for now.tc
- Transaction controller
StandardException
- Thrown on error.private final TupleDescriptor getDescriptorViaIndexMinion(int indexId, ExecIndexRow keyRow, ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, java.util.List list, boolean forUpdate, int isolationLevel, TransactionController tc) throws StandardException
StandardException
private void debugGenerateInfo(java.lang.StringBuffer strbuf, TransactionController tc, ConglomerateController heapCC, TabInfoImpl ti, int indexId)
protected TupleDescriptor getDescriptorViaHeap(ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, java.util.List list) throws StandardException
scanQualifiers
- qualifiersti
- The TabInfoImpl to useparentTupleDescriptor
- The parentDescriptor, if applicable.list
- The list to build, if supplied.
If null, then caller expects a single descriptor
StandardException
- Thrown on errorprivate TabInfoImpl getNonCoreTI(int catalogNumber) throws StandardException
catalogNumber
- The index into noncoreTable[].
StandardException
- Thrown on errorprotected TabInfoImpl getNonCoreTIByNumber(int catalogNumber) throws StandardException
StandardException
protected void initSystemIndexVariables(TabInfoImpl ti) throws StandardException
StandardException
private void clearNoncoreTable(int nonCoreNum)
public void faultInTabInfo(TabInfoImpl ti) throws StandardException
ti
- TabInfoImpl to fault in.
StandardException
- Thrown on errorpublic static ExecIndexRow getIndexRowFromHeapRow(IndexRowGenerator irg, RowLocation rl, ExecRow heapRow) throws StandardException
irg
- IndexRowGenerator to userl
- RowLocation for heapheapRow
- Row from the heap
StandardException
- Thrown on errorpublic int getEngineType()
getEngineType
in interface DataDictionary
public long getSYSCOLUMNSHeapConglomerateNumber()
void addSYSCOLUMNSIndex2Property(TransactionController tc, long index2ConglomerateNumber)
private long getBootParameter(java.util.Properties startParams, java.lang.String key, boolean required) throws StandardException
StandardException
public java.lang.String getSystemSQLName()
getSystemSQLName
in interface DataDictionary
private static java.lang.String twoDigits(int val)
public void setAutoincrementValue(TransactionController tc, UUID tableUUID, java.lang.String columnName, long aiValue, boolean incrementNeeded) throws StandardException
setAutoincrementValue
in interface DataDictionary
tc
- Transaction Controller to use.columnName
- Name of the column.aiValue
- Value to write to SYSCOLUMNS.incrementNeeded
- whether to increment the value passed in by the
user (aiValue) or not before writing it to SYSCOLUMNS.tableUUID
- Table Descriptor
StandardException
private RowLocation computeRowLocation(TransactionController tc, TableDescriptor td, java.lang.String columnName) throws StandardException
tc
- Transaction Controller to use.td
- Table Descriptor.columnName
- Name of column which has autoincrement column.
StandardException
- thrown on failure.void computeSequenceRowLocation(TransactionController tc, java.lang.String sequenceIDstring, RowLocation[] rowLocation, SequenceDescriptor[] sequenceDescriptor) throws StandardException
tc
- Transaction Controller to use.sequenceIDstring
- UUID of the sequence as a stringrowLocation
- OUTPUT param for returing the row locationsequenceDescriptor
- OUTPUT param for return the sequence descriptor
StandardException
- thrown on failure.boolean updateCurrentSequenceValue(TransactionController tc, RowLocation rowLocation, boolean wait, java.lang.Long oldValue, java.lang.Long newValue) throws StandardException
tc
- Transaction Controller to use.rowLocation
- Row in SYSSEQUENCES to update.wait
- True if we should wait for locksoldValue
- What we expect to find in the CURRENTVALUE column.newValue
- What to stuff into the CURRENTVALUE column.
StandardException
- thrown on failure.public void getCurrentValueAndAdvance(java.lang.String sequenceUUIDstring, NumberDataValue returnValue) throws StandardException
DataDictionary
getCurrentValueAndAdvance
in interface DataDictionary
sequenceUUIDstring
- String value of the UUID which identifies the sequencereturnValue
- This is a data value to be stuffed with the next sequence number.
StandardException
- if the sequence does not cycle and its range is exhaustedDataDictionary.getCurrentValueAndAdvance(java.lang.String, org.apache.derby.iapi.types.NumberDataValue)
public RowLocation getRowLocationTemplate(LanguageConnectionContext lcc, TableDescriptor td) throws StandardException
getRowLocationTemplate
in interface DataDictionary
StandardException
public void addTableDescriptorToOtherCache(TableDescriptor td, Cacheable c) throws StandardException
td
- TableDescriptor to add to the other cache.c
- Cacheable Object which lets us figure out the other cache.
StandardException
public void dropStatisticsDescriptors(UUID tableUUID, UUID referenceUUID, TransactionController tc) throws StandardException
DataDictionary
dropStatisticsDescriptors
in interface DataDictionary
tableUUID
- UUID of the tablereferenceUUID
- UUID of the index. This can be null.tc
- Transcation Controller to use.
StandardException
DataDictionary.dropStatisticsDescriptors(org.apache.derby.catalog.UUID, org.apache.derby.catalog.UUID, org.apache.derby.iapi.store.access.TransactionController)
private static LanguageConnectionContext getLCC()
private SchemaDescriptor newSystemSchemaDesc(java.lang.String name, java.lang.String uuid)
private SchemaDescriptor newDeclaredGlobalTemporaryTablesSchemaDesc(java.lang.String name)
public boolean checkVersion(int requiredMajorVersion, java.lang.String feature) throws StandardException
checkVersion
in interface DataDictionary
requiredMajorVersion
- Data Dictionary major versionfeature
- Non-null to throw an error, null to return the state of the version match.
StandardException
void createSystemSps(TransactionController tc) throws StandardException
StandardException
protected void createSPSSet(TransactionController tc, boolean net, UUID schemaID) throws StandardException
StandardException
private final UUID createSystemProcedureOrFunction(java.lang.String routine_name, UUID schema_uuid, java.lang.String[] arg_names, TypeDescriptor[] arg_types, int num_out_param, int num_result_sets, short routine_sql_control, boolean isDeterministic, TypeDescriptor return_type, java.util.HashSet newlyCreatedRoutines, TransactionController tc, java.lang.String procClass) throws StandardException
Takes the input procedure and inserts it into the appropriate catalog. Assumes all arguments are "IN" type.
routine_name
- name of the routine in java and the SQL
procedure name.arg_names
- String array of procedure argument names in order.arg_types
- Internal SQL types of the argumentsroutine_sql_control
- One of the RoutineAliasInfo constants:
MODIFIES_SQL_DATA
READS_SQL_DATA
CONTAINS_SQL
NO_SQLisDeterministic
- True if the procedure/function is DETERMINISTICreturn_type
- null for procedure. For functions the return type
of the function.newlyCreatedRoutines
- evolving set of routines, some of which may need permissions later ontc
- an instance of the TransactionControllerprocClass
- the fully qualified name of the class that contains
java definitions for the stored procedures
StandardException
- Standard exception policy.private final UUID createSystemProcedureOrFunction(java.lang.String routine_name, UUID schema_uuid, java.lang.String[] arg_names, TypeDescriptor[] arg_types, int num_out_param, int num_result_sets, short routine_sql_control, boolean isDeterministic, TypeDescriptor return_type, java.util.HashSet newlyCreatedRoutines, TransactionController tc) throws StandardException
routine_name
- name of the routine in java and the SQL
procedure name.arg_names
- String array of procedure argument names in order.arg_types
- Internal SQL types of the argumentsroutine_sql_control
- One of the RoutineAliasInfo constants:
MODIFIES_SQL_DATA
READS_SQL_DATA
CONTAINS_SQL
NO_SQLisDeterministic
- True if the procedure/function is DETERMINISTICreturn_type
- null for procedure. For functions the return type
of the function.newlyCreatedRoutines
- evolving set of routines, some of which may need permissions later ontc
- an instance of the TransactionController
StandardException
- Standard exception policy.private final void create_SYSCS_procedures(TransactionController tc, java.util.HashSet newlyCreatedRoutines) throws StandardException
Used to add the system procedures to the database when it is created. System procedures are currently added to either SYSCS_UTIL or SQLJ schemas.
tc
- transaction controller to use. Counts on caller to
commit.newlyCreatedRoutines
- evolving set of routines which may need to be given permissions later on
StandardException
- Standard exception policy.protected final void create_SYSIBM_procedures(TransactionController tc, java.util.HashSet newlyCreatedRoutines) throws StandardException
Used to add the system procedures to the database when it is created. Full upgrade from version 5.1 or earlier also calls this method.
newlyCreatedRoutines
- evolving set of routines which we're adding (some may need permissions later on)tc
- transaction controller to use. Counts on caller to
commit.
StandardException
- Standard exception policy.public void grantPublicAccessToSystemRoutines(java.util.HashSet newlyCreatedRoutines, TransactionController tc, java.lang.String authorizationID) throws StandardException
tc
- TransactionController to useauthorizationID
- authorization ID of the permission grantor
StandardException
- Standard exception policy.private void grantPublicAccessToSystemRoutine(java.lang.String schemaID, java.lang.String routineName, char nameSpace, TransactionController tc, java.lang.String authorizationID) throws StandardException
schemaID
- Schema IDroutineName
- Routine NamenameSpace
- Indicates whether the routine is a function/procedure.tc
- TransactionController to useauthorizationID
- authorization ID of the permission grantor
StandardException
- Standard exception policy.void createRoutinePermPublicDescriptor(UUID routineUUID, TransactionController tc, java.lang.String authorizationID) throws StandardException
routineUUID
- uuid of the routinetc
- TransactionController to useauthorizationID
- authorization ID of the permission grantor
StandardException
- Standard exception policy.void create_10_1_system_procedures(TransactionController tc, java.util.HashSet newlyCreatedRoutines, UUID sysUtilUUID) throws StandardException
Create 10.1 system procedures, called by either code creating new database, or code doing hard upgrade from previous version.
tc
- booting transactionnewlyCreatedRoutines
- set of routines we are creating (used to add permissions later on)sysUtilUUID
- uuid of the SYSUTIL schema.
StandardException
- Standard exception policy.void create_10_2_system_procedures(TransactionController tc, java.util.HashSet newlyCreatedRoutines, UUID sysUtilUUID) throws StandardException
Create 10.2 system procedures, called by either code creating new database, or code doing hard upgrade from previous version.
tc
- booting transactionnewlyCreatedRoutines
- set of routines we are creating (used to add permissions later on)sysUtilUUID
- uuid of the SYSUTIL schema.
StandardException
- Standard exception policy.private void create_10_3_system_procedures_SYSIBM(TransactionController tc, java.util.HashSet newlyCreatedRoutines) throws StandardException
tc
- an instance of the TransactionController class.newlyCreatedRoutines
- set of routines we are creating (used to add permissions later on)
StandardException
- Standard exception policy.void create_10_5_system_procedures(TransactionController tc, java.util.HashSet newlyCreatedRoutines) throws StandardException
tc
- an instance of the TransactionController.newlyCreatedRoutines
- set of routines we are creating (used to add permissions later on)
StandardException
- Standard exception policy.void create_10_6_system_procedures(TransactionController tc, java.util.HashSet newlyCreatedRoutines) throws StandardException
tc
- an instance of the TransactionController.
StandardException
- Standard exception policy.void create_10_3_system_procedures(TransactionController tc, java.util.HashSet newlyCreatedRoutines) throws StandardException
tc
- an instance of the TransactionController.newlyCreatedRoutines
- set of routines we are creating (used to add permissions later on)
StandardException
- Standard exception policy.void create_10_3_system_procedures_SYSCS_UTIL(TransactionController tc, java.util.HashSet newlyCreatedRoutines) throws StandardException
Create 10.3 system procedures, called by either code creating new database, or code doing hard upgrade from previous version.
tc
- an instance of the Transaction Controller.newlyCreatedRoutines
- set of routines we are creating (used to add permissions later on)
StandardException
- Standard exception policy.private final java.util.Properties getQueryDescriptions(boolean net)
public final java.lang.Object run()
run
in interface java.security.PrivilegedAction
private static java.util.List newSList()
public TablePermsDescriptor getTablePermissions(UUID tableUUID, java.lang.String authorizationId) throws StandardException
getTablePermissions
in interface DataDictionary
tableUUID
- authorizationId
- The user name
StandardException
public TablePermsDescriptor getTablePermissions(UUID tablePermsUUID) throws StandardException
DataDictionary
getTablePermissions
in interface DataDictionary
StandardException
private java.lang.Object getPermissions(PermissionsDescriptor key) throws StandardException
StandardException
public ColPermsDescriptor getColumnPermissions(UUID colPermsUUID) throws StandardException
DataDictionary
getColumnPermissions
in interface DataDictionary
StandardException
public ColPermsDescriptor getColumnPermissions(UUID tableUUID, int privType, boolean forGrant, java.lang.String authorizationId) throws StandardException
getColumnPermissions
in interface DataDictionary
tableUUID
- privType
- (as int) Authorizer.SELECT_PRIV, Authorizer.UPDATE_PRIV, or Authorizer.REFERENCES_PRIVforGrant
- authorizationId
- The user name
StandardException
public ColPermsDescriptor getColumnPermissions(UUID tableUUID, java.lang.String privTypeStr, boolean forGrant, java.lang.String authorizationId) throws StandardException
getColumnPermissions
in interface DataDictionary
tableUUID
- privTypeStr
- (as String) Authorizer.SELECT_PRIV, Authorizer.UPDATE_PRIV, or Authorizer.REFERENCES_PRIVforGrant
- authorizationId
- The user name
StandardException
public RoutinePermsDescriptor getRoutinePermissions(UUID routineUUID, java.lang.String authorizationId) throws StandardException
getRoutinePermissions
in interface DataDictionary
routineUUID
- authorizationId
- The user's name
StandardException
public RoutinePermsDescriptor getRoutinePermissions(UUID routinePermsUUID) throws StandardException
DataDictionary
getRoutinePermissions
in interface DataDictionary
StandardException
public boolean addRemovePermissionsDescriptor(boolean add, PermissionsDescriptor perm, java.lang.String grantee, TransactionController tc) throws StandardException
addRemovePermissionsDescriptor
in interface DataDictionary
add
- if true then the permission is added, if false the permission is removedperm
- grantee
- tc
-
StandardException
TablePermsDescriptor getUncachedTablePermsDescriptor(TablePermsDescriptor key) throws StandardException
StandardException
ColPermsDescriptor getUncachedColPermsDescriptor(ColPermsDescriptor key) throws StandardException
StandardException
private TupleDescriptor getUncachedPermissionsDescriptor(int catalogNumber, int indexNumber, PermissionsDescriptor key) throws StandardException
StandardException
RoutinePermsDescriptor getUncachedRoutinePermsDescriptor(RoutinePermsDescriptor key) throws StandardException
StandardException
public java.lang.String getVTIClass(TableDescriptor td, boolean asTableFunction) throws StandardException
DataDictionary
getVTIClass
in interface DataDictionary
td
- Table descriptor used for the VTI look-up.asTableFunction
- If false then treat td's descriptor name as a
VTI "table name"; if true, treat the descriptor name as a VTI "table
function name".
StandardException
DataDictionary.getVTIClass(TableDescriptor, boolean)
public java.lang.String getBuiltinVTIClass(TableDescriptor td, boolean asTableFunction) throws StandardException
DataDictionary
getBuiltinVTIClass
in interface DataDictionary
td
- Table descriptor used for the VTI look-up.asTableFunction
- If false then treat td's descriptor name as a
VTI "table name"; if true, treat the descriptor name as a VTI "table
function name".
StandardException
DataDictionary.getBuiltinVTIClass(TableDescriptor, boolean)
public RoleGrantDescriptor getRoleGrantDescriptor(UUID uuid) throws StandardException
DataDictionary
getRoleGrantDescriptor
in interface DataDictionary
StandardException
- Thrown on errorDataDictionary.getRoleGrantDescriptor(UUID)
public RoleGrantDescriptor getRoleDefinitionDescriptor(java.lang.String roleName) throws StandardException
getRoleDefinitionDescriptor
in interface DataDictionary
roleName
- The name of the role we're interested in.
StandardException
- Thrown on errorDataDictionary.getRoleDefinitionDescriptor(java.lang.String)
public RoleGrantDescriptor getRoleGrantDescriptor(java.lang.String roleName, java.lang.String grantee, java.lang.String grantor) throws StandardException
getRoleGrantDescriptor
in interface DataDictionary
roleName
- The name of the role we're interested in.grantee
- The granteegrantor
- The grantor
StandardException
- Thrown on errorDataDictionary.getRoleGrantDescriptor(String, String, String)
public boolean existsGrantToAuthid(java.lang.String authId, TransactionController tc) throws StandardException
authId
as its grantee.
existsGrantToAuthid
in interface DataDictionary
authId
- grantee for which a grant exists or nottc
- TransactionController for the transaction
StandardException
private void dropJDBCMetadataSPSes(TransactionController tc) throws StandardException
tc
- the xact
StandardException
public void updateMetadataSPSes(TransactionController tc) throws StandardException
updateMetadataSPSes
in interface DataDictionary
tc
- the xact
StandardException
public void dropSequenceDescriptor(SequenceDescriptor descriptor, TransactionController tc) throws StandardException
dropSequenceDescriptor
in interface DataDictionary
descriptor
- The descriptor to droptc
- The TransactionController.
StandardException
- Thrown on failurepublic SequenceDescriptor getSequenceDescriptor(UUID uuid) throws StandardException
DataDictionary
getSequenceDescriptor
in interface DataDictionary
uuid
- uuid of the sequence
StandardException
- errorpublic SequenceDescriptor getSequenceDescriptor(SchemaDescriptor sd, java.lang.String sequenceName) throws StandardException
getSequenceDescriptor
in interface DataDictionary
sequenceName
- The sequence name, guaranteed to be unique only within its schema.sd
- The schema descriptor.
StandardException
- Thrown on failurePermDescriptor getUncachedGenericPermDescriptor(PermDescriptor key) throws StandardException
StandardException
public PermDescriptor getGenericPermissions(UUID objectUUID, java.lang.String objectType, java.lang.String privilege, java.lang.String granteeAuthId) throws StandardException
getGenericPermissions
in interface DataDictionary
objectUUID
- The id of the protected objectobjectType
- Type of the object (e.g., SEQUENCE)privilege
- The kind of privilege needed (e.g., PermDescriptor.USAGE_PRIV)granteeAuthId
- The user or role who wants to have permission on this object
StandardException
public PermDescriptor getGenericPermissions(UUID permUUID) throws StandardException
getGenericPermissions
in interface DataDictionary
permUUID
-
StandardException
public void dropAllPermDescriptors(UUID objectID, TransactionController tc) throws StandardException
dropAllPermDescriptors
in interface DataDictionary
objectID
- The UUID of the object from which to drop
all the permission descriptorstc
- TransactionController for the transaction
StandardException
- Thrown on error
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |