java.security.PrivilegedAction<java.util.Properties>, CacheableFactory, ModuleControl, ModuleSupportable, DataDictionarypublic final class DataDictionaryImpl extends java.lang.Object implements DataDictionary, CacheableFactory, ModuleControl, ModuleSupportable, java.security.PrivilegedAction<java.util.Properties>
| Modifier and Type | Field | Description |
|---|---|---|
(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.
|
private IndexStatisticsDaemon |
indexRefresher |
Daemon creating and refreshing index cardinality statistics.
|
private boolean |
indexStatsUpdateDisabled |
Tells if the automatic index statistics refresher has been disabled.
|
private boolean |
indexStatsUpdateLogging |
|
private java.lang.String |
indexStatsUpdateTracing |
|
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 |
|
private 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 java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> |
sequenceIDs |
|
private DD_Version |
softwareVersion |
Dictionary version of the currently running engine
|
private java.util.Hashtable<UUID,SPSDescriptor> |
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 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 static int |
SYSFUN_VARARGS_INDEX |
Index into SYSFUN_FUNCTIONS of the VARARGS indicator.
|
private AliasDescriptor[] |
sysfunDescriptors |
Runtime definition of the functions from 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
|
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 |
CATALOG_TYPE_SYSTEM_IDENTIFIER, CHECK_CONSTRAINT, COMPILE_ONLY_MODE, CORE_DATA_DICTIONARY_VERSION, CREATE_DATA_DICTIONARY_VERSION, DATABASE_ID, DD_VERSION_CS_10_0, DD_VERSION_CS_5_0, DD_VERSION_CS_5_1, DD_VERSION_CS_5_2, DD_VERSION_CS_8_1, DD_VERSION_CURRENT, DD_VERSION_DERBY_10_1, DD_VERSION_DERBY_10_10, DD_VERSION_DERBY_10_11, DD_VERSION_DERBY_10_12, DD_VERSION_DERBY_10_13, DD_VERSION_DERBY_10_14, DD_VERSION_DERBY_10_2, DD_VERSION_DERBY_10_3, DD_VERSION_DERBY_10_4, DD_VERSION_DERBY_10_5, DD_VERSION_DERBY_10_6, DD_VERSION_DERBY_10_7, DD_VERSION_DERBY_10_8, DD_VERSION_DERBY_10_9, DDL_MODE, DROP_CONSTRAINT, FOREIGNKEY_CONSTRAINT, MODIFY_CONSTRAINT, MODULE, NOTNULL_CONSTRAINT, PRIMARYKEY_CONSTRAINT, PROPERTY_CONGLOMERATE_VERSION, SOFT_DATA_DICTIONARY_VERSION, SYSALIASES_CATALOG_NUM, SYSCHECKS_CATALOG_NUM, SYSCOLPERMS_CATALOG_NUM, SYSCOLUMNS_CATALOG_NUM, SYSCONGLOMERATES_CATALOG_NUM, SYSCONSTRAINTS_CATALOG_NUM, SYSDEPENDS_CATALOG_NUM, SYSDUMMY1_CATALOG_NUM, SYSFILES_CATALOG_NUM, SYSFOREIGNKEYS_CATALOG_NUM, SYSKEYS_CATALOG_NUM, SYSPERMS_CATALOG_NUM, SYSROLES_CATALOG_NUM, SYSROUTINEPERMS_CATALOG_NUM, SYSSCHEMAS_CATALOG_NUM, SYSSEQUENCES_CATALOG_NUM, SYSSTATEMENTS_CATALOG_NUM, SYSSTATISTICS_CATALOG_NUM, SYSTABLEPERMS_CATALOG_NUM, SYSTABLES_CATALOG_NUM, SYSTRIGGERS_CATALOG_NUM, SYSUSERS_CATALOG_NUM, SYSVIEWS_CATALOG_NUM, TYPE_SYSTEM_IDENTIFIER, UNIQUE_CONSTRAINT| Constructor | Description |
|---|---|
DataDictionaryImpl() |
| Modifier and Type | Method | Description |
|---|---|---|
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 static java.lang.Object |
bootServiceModule(boolean create,
java.lang.Object serviceModule,
java.lang.String factoryInterface,
java.util.Properties properties) |
Privileged startup.
|
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.
|
private void |
checkInvalidTriggerReference(java.lang.String tableName,
java.lang.String oldReferencingName,
java.lang.String newReferencingName,
int triggerEventMask) |
|
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.
|
void |
clearCaches(boolean clearSequenceCaches) |
Clear the DataDictionary caches, including the sequence caches if requested..
|
private void |
clearNoncoreTable(int nonCoreNum) |
|
void |
clearSequenceCaches() |
Flush sequence caches to disk so that we don't leak unused, pre-allocated numbers.
|
(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.
|
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<java.lang.String> newlyCreatedRoutines,
UUID sysUtilUUID) |
Create system procedures added in version 10.1.
|
(package private) void |
create_10_10_system_procedures(TransactionController tc,
java.util.HashSet<java.lang.String> newlyCreatedRoutines) |
Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.10.
|
(package private) void |
create_10_11_system_procedures(TransactionController tc,
java.util.HashSet<java.lang.String> newlyCreatedRoutines) |
Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.11.
|
(package private) void |
create_10_12_system_procedures(TransactionController tc,
java.util.HashSet<java.lang.String> newlyCreatedRoutines) |
Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.12.
|
(package private) void |
create_10_13_system_procedures(TransactionController tc,
java.util.HashSet<java.lang.String> newlyCreatedRoutines) |
Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.13.
|
(package private) void |
create_10_2_system_procedures(TransactionController tc,
java.util.HashSet<java.lang.String> newlyCreatedRoutines,
UUID sysUtilUUID) |
Create system procedures added in version 10.2.
|
(package private) void |
create_10_3_system_procedures(TransactionController tc,
java.util.HashSet<java.lang.String> newlyCreatedRoutines) |
Create the System procedures that are added in 10.3.
|
(package private) void |
create_10_3_system_procedures_SYSCS_UTIL(TransactionController tc,
java.util.HashSet<java.lang.String> 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<java.lang.String> newlyCreatedRoutines) |
Create system procedures added in version 10.3.
|
(package private) void |
create_10_5_system_procedures(TransactionController tc,
java.util.HashSet<java.lang.String> newlyCreatedRoutines) |
Create the System procedures that are added to 10.5.
|
(package private) void |
create_10_6_system_procedures(TransactionController tc,
java.util.HashSet<java.lang.String> newlyCreatedRoutines) |
Create the System procedures that are added to 10.6.
|
(package private) void |
create_10_9_system_procedures(TransactionController tc,
java.util.HashSet<java.lang.String> newlyCreatedRoutines) |
Create system procedures that are part of the
SYSCS_UTIL schema added in version 10.9.
|
private void |
create_SYSCS_procedures(TransactionController tc,
java.util.HashSet<java.lang.String> newlyCreatedRoutines) |
Create system procedures
|
protected void |
create_SYSIBM_procedures(TransactionController tc,
java.util.HashSet<java.lang.String> newlyCreatedRoutines) |
Create system procedures in SYSIBM
|
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.
|
private void |
createIdentitySequence(TableDescriptor td,
ColumnDescriptor cd,
TransactionController tc) |
Create a sequence generator for an identity column on upgrade to 10.11.
|
(package private) void |
createIdentitySequences(TransactionController tc) |
Create sequence generators for all identity columns on upgrade to 10.11.
|
void |
createIndexStatsRefresher(Database db,
java.lang.String dbName) |
Creates an index statistics refresher for this data dictionary.
|
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,
boolean hasVarargs,
TypeDescriptor return_type,
java.util.HashSet<java.lang.String> 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,
boolean hasVarargs,
TypeDescriptor return_type,
java.util.HashSet<java.lang.String> 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 |
disableIndexStatsRefresher() |
Disables automatic refresh/creation of index statistics at runtime.
|
boolean |
doCreateIndexStatsRefresher() |
Tells if an index statistics refresher should be created for this
database.
|
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
|
private void |
dropSequenceID(SequenceDescriptor sd) |
Drop a sequenceID from the ( schemaName, sequenceName ) map
|
void |
dropSPSDescriptor(UUID uuid,
TransactionController tc) |
Drops the given SPSDescriptor.
|
void |
dropSPSDescriptor(SPSDescriptor descriptor,
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 |
dropUser(java.lang.String userName,
TransactionController tc) |
Drop a User from the DataDictionary
|
void |
dropViewDescriptor(ViewDescriptor vd,
TransactionController tc) |
Drops the view descriptor from the data dictionary.
|
private StandardException |
duplicateDescriptorException(TupleDescriptor tuple,
TupleDescriptor parent) |
|
int[] |
examineTriggerNodeAndCols(Visitable actionStmt,
java.lang.String oldReferencingName,
java.lang.String newReferencingName,
java.lang.String triggerDefinition,
int[] referencedCols,
int[] referencedColsInTriggerAction,
int actionOffset,
TableDescriptor triggerTableDescriptor,
int triggerEventMask,
boolean createTriggerTime,
java.util.List<int[]> replacements) |
Get the trigger action string associated with the trigger after the
references to old/new transition tables/variables in trigger action
sql provided by CREATE TRIGGER have been transformed eg
DELETE FROM t WHERE c = old.c
turns into
DELETE FROM t WHERE c = org.apache.derby.iapi.db.Factory::
getTriggerExecutionContext().getOldRow().
|
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.
|
private 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 static java.lang.Object |
findServiceModule(java.lang.Object serviceModule,
java.lang.String factoryInterface) |
Privileged startup.
|
private TableDescriptor |
finishTableDescriptor(TableDescriptor td) |
Finish filling in the TableDescriptor.
|
void |
flushBulkInsertCounter(java.lang.String sequenceUUIDString,
BulkInsertCounter bic) |
Flush the updated values of the BulkInsertCounter to disk and to the original, cached
SequenceUpdater.
|
private java.lang.String |
genColumnReferenceSQL(TableDescriptor td,
java.lang.String colName,
java.lang.String tabName,
boolean isOldTable,
int colPositionInRuntimeResultSet) |
|
private byte[] |
generateRandomSalt(java.util.Dictionary props) |
Generate an array of random bytes to use as salt when hashing
credentials.
|
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<TupleDescriptor> |
getAllDependencyDescriptorsList() |
Build and return an List with DependencyDescriptors for
all of the stored dependencies.
|
java.util.List<SPSDescriptor> |
getAllSPSDescriptors() |
Get every statement 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.
|
BulkInsertCounter |
getBulkInsertCounter(java.lang.String sequenceUUIDString,
boolean restart) |
Get the identity generator used to support the bulk-insert optimization
in InsertResultSet.
|
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.
|
DependableFinder |
getColumnDependableFinder(int formatId,
byte[] columnBitMap) |
Get a
DependableFinder instance for referenced columns in
a table. |
ColumnDescriptor |
getColumnDescriptorByDefaultId(UUID uuid) |
Get a ColumnDescriptor given its Default ID.
|
private void |
getColumnDescriptorsScan(UUID uuid,
ColumnDescriptorList cdl,
TupleDescriptor td) |
Populate the ColumnDescriptorList for the specified TableDescriptor.
|
private void |
getColumnDescriptorsScan(TableDescriptor 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(UUID uuid) |
Get a ConstraintDescriptor given its UUID.
|
ConstraintDescriptor |
getConstraintDescriptor(TableDescriptor td,
UUID uuid) |
Get the constraint descriptor given a table and the UUID String
of the backing index.
|
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,
ConstraintDescriptorList 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<UUID> |
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.
|
private static Context |
getContext(java.lang.String contextID) |
Privileged lookup of a Context.
|
private static Context |
getContextOrNull(java.lang.String contextID) |
Privileged lookup of a Context.
|
private static ContextService |
getContextService() |
Privileged lookup of the ContextService.
|
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".
|
DependableFinder |
getDependableFinder(int formatId) |
Get a
DependableFinder instance. |
DependencyManager |
getDependencyManager() |
returns the dependencymanager associated with this datadictionary.
|
java.util.List<DependencyDescriptor> |
getDependentsDescriptorList(java.lang.String dependentID) |
Gets a list of the dependency descriptors for the given dependent's id.
|
protected <T extends TupleDescriptor> |
getDescriptorViaHeap(FormatableBitSet columns,
ScanQualifier[][] scanQualifiers,
TabInfoImpl ti,
TupleDescriptor parentTupleDescriptor,
java.util.List<? super T> list,
java.lang.Class<T> returnType) |
Return a (single or list of) catalog row descriptor(s) from a
system table where the access a heap scan
|
private <T extends TupleDescriptor> |
getDescriptorViaIndex(int indexId,
ExecIndexRow keyRow,
ScanQualifier[][] scanQualifiers,
TabInfoImpl ti,
TupleDescriptor parentTupleDescriptor,
java.util.List<? super T> list,
java.lang.Class<T> returnType,
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 <T extends TupleDescriptor> |
getDescriptorViaIndex(int indexId,
ExecIndexRow keyRow,
ScanQualifier[][] scanQualifiers,
TabInfoImpl ti,
TupleDescriptor parentTupleDescriptor,
java.util.List<? super T> list,
java.lang.Class<T> returnType,
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 <T extends TupleDescriptor> |
getDescriptorViaIndexMinion(int indexId,
ExecIndexRow keyRow,
ScanQualifier[][] scanQualifiers,
TabInfoImpl ti,
TupleDescriptor parentTupleDescriptor,
java.util.List<? super T> list,
java.lang.Class<T> returnType,
boolean forUpdate,
int isolationLevel,
TransactionController tc) |
|
int |
getEngineType() |
|
ExecutionFactory |
getExecutionFactory() |
Get ExecutionFactory associated with this database.
|
FileInfoDescriptor |
getFileInfoDescriptor(UUID id) |
Get a FileInfoDescriptor given its id.
|
FileInfoDescriptor |
getFileInfoDescriptor(SchemaDescriptor sd,
java.lang.String name) |
Get a FileInfoDescriptor given its SQL name and
schema name.
|
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.
|
IndexStatisticsDaemon |
getIndexStatsRefresher(boolean asDaemon) |
Returns the index statistics refresher.
|
private int |
getIntProperty(java.util.Dictionary props,
java.lang.String key,
int defaultValue,
int minValue,
int maxValue) |
Get the value of an integer property.
|
private static LanguageConnectionContext |
getLCC() |
|
(package private) static ModuleFactory |
getMonitor() |
Privileged Monitor lookup.
|
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<DependencyDescriptor> |
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<java.lang.String,java.util.List<RoleGrantDescriptor>> |
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<AliasDescriptor> |
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(UUID uuid) |
get a descriptor for a Sequence by uuid
|
SequenceDescriptor |
getSequenceDescriptor(SchemaDescriptor sd,
java.lang.String sequenceName) |
Get the sequence descriptor given a sequence name and a schema Id.
|
private java.lang.String |
getSequenceID(java.lang.String schemaName,
java.lang.String sequenceName) |
Get the uuid string of a sequence given its schema and sequence name.
|
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.List<DataValueDescriptor> defaults) |
Get all the parameter descriptors for an SPS.
|
java.util.List<StatisticsDescriptor> |
getStatisticsDescriptors(TableDescriptor td) |
Returns all the statistics descriptors for the 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.
|
private static java.util.SortedSet<ColumnReference> |
getTransitionVariables(Visitable node,
java.lang.String oldReferencingName,
java.lang.String newReferencingName) |
Get all columns that reference transition variables in triggers.
|
java.lang.String |
getTriggerActionString(Visitable actionStmt,
java.lang.String oldReferencingName,
java.lang.String newReferencingName,
java.lang.String triggerDefinition,
int[] referencedCols,
int[] referencedColsInTriggerAction,
int actionOffset,
TableDescriptor triggerTableDescriptor,
int triggerEventMask,
boolean createTriggerTime,
java.util.List<int[]> replacements,
int[] cols) |
This method does the job of transforming the trigger action plan text
as shown below.
|
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.
|
TriggerDescriptorList |
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 TriggerDescriptorList 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 <T extends PermissionsDescriptor> |
getUncachedPermissionsDescriptor(int catalogNumber,
int indexNumber,
T key,
java.lang.Class<T> returnType) |
|
(package private) RoutinePermsDescriptor |
getUncachedRoutinePermsDescriptor(RoutinePermsDescriptor key) |
Get a routine permissions descriptor from the system tables, without going through the cache.
|
protected SPSDescriptor |
getUncachedSPSDescriptor(UUID stmtId) |
This method can get called from the DataDictionary cache.
|
(package private) SPSDescriptor |
getUncachedSPSDescriptor(TableKey stmtKey) |
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) TableDescriptor |
getUncachedTableDescriptor(TableKey tableKey) |
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.
|
UserDescriptor |
getUser(java.lang.String userName) |
Return the credentials descriptor for the named user.
|
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(UUID uuid) |
Gets the viewDescriptor for the view with the given UUID.
|
ViewDescriptor |
getViewDescriptor(TableDescriptor td) |
Gets the viewDescriptor for the view given the TableDescriptor.
|
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<java.lang.Long,ConglomerateDescriptor> |
hashAllConglomerateDescriptorsByNumber(TransactionController tc) |
Get all of the ConglomerateDescriptors in the database and
hash them by conglomerate number.
|
java.util.Hashtable<UUID,TableDescriptor> |
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.
|
protected void |
initSystemIndexVariables(TabInfoImpl ti) |
|
private void |
initSystemIndexVariables(TabInfoImpl ti,
int indexNumber) |
|
void |
invalidateAllSPSPlans() |
Invalidate all the stored plans in SYS.SYSSTATEMENTS.
|
void |
invalidateAllSPSPlans(LanguageConnectionContext lcc) |
Invalidate all the stored plans in SYS.SYSSTATEMENTS for
the given language connection context.
|
boolean |
isReadOnlyUpgrade() |
Check if the database is read only and requires some form of upgrade
that makes the stored prepared statements invalid.
|
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.
|
private static boolean |
isTransitionVariable(TableName tableName,
java.lang.String oldReferencingName,
java.lang.String newReferencingName) |
Check if a table name is actually a transition variable.
|
private int[] |
justTheRequiredColumns(int[] columnsArrary,
TableDescriptor triggerTableDescriptor) |
|
private void |
loadCatalogs(TabInfoImpl[] catalogArray) |
Initialize indices for an array of catalogs
|
private void |
loadDictionaryTables(TransactionController tc,
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) |
|
private 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.
|
PasswordHasher |
makePasswordHasher(java.util.Dictionary<?,?> props) |
Get the default password hasher for this database level.
|
Cacheable |
newCacheable(CacheManager cm) |
|
private SchemaDescriptor |
newDeclaredGlobalTemporaryTablesSchemaDesc(java.lang.String name) |
|
private static <T> java.util.List<T> |
newSList() |
|
private SchemaDescriptor |
newSystemSchemaDesc(java.lang.String name,
java.lang.String uuid) |
|
java.lang.Long |
peekAtIdentity(java.lang.String schemaName,
java.lang.String tableName) |
Peek at the next value which will be returned by an identity generator.
|
java.lang.Long |
peekAtSequence(java.lang.String schemaName,
java.lang.String sequenceName) |
Peek at the next value which will be returned by a sequence generator.
|
protected void |
populateSYSDUMMY1(TransactionController tc) |
Populate SYSDUMMY1 table with a single row.
|
private void |
putSequenceID(SequenceDescriptor sd) |
Map ( schemaName, sequenceName ) to sequenceID
|
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.util.Properties |
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 |
setReadOnlyUpgrade() |
Mark this database as a read only database whose stored prepared
statements are invalid because some kind of upgrade is needed.
|
(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.
|
private static java.lang.Object |
startSystemModule(java.lang.String factoryInterface) |
Privileged startup.
|
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.
|
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) |
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 |
updateUser(UserDescriptor newDescriptor,
TransactionController tc) |
Update a user.
|
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
|
(package private) void |
upgrade_SYSCOLUMNS_AUTOINCCYCLE(TransactionController tc) |
Add autoinccycle columns to an SYSCOLUMNS system catalog
|
(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 |
upgradeJarStorage(TransactionController tc) |
Called by the upgrade code to upgrade the way we store jar files in the
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.
|
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] = "true" or "false" depending on whether the function has VARARGS
[6..N] = arguments (optional, if not present zero arguments is assumed)private static final int SYSFUN_DETERMINISTIC_INDEX
private static final int SYSFUN_VARARGS_INDEX
private static final int SYSFUN_FIRST_PARAMETER_INDEX
private final AliasDescriptor[] sysfunDescriptors
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
private IndexStatisticsDaemon indexRefresher
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<UUID,SPSDescriptor> 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
private java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> sequenceIDs
private 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 boolean indexStatsUpdateDisabled
The refresher can be disabled explicitly by the user by setting a property (system wide or database property), or if the daemon encounters an exception it doesn't know how to recover from.
private boolean indexStatsUpdateLogging
private java.lang.String indexStatsUpdateTracing
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
public boolean canSupport(java.util.Properties startParams)
canSupport in interface ModuleSupportablepublic void boot(boolean create,
java.util.Properties startParams)
throws StandardException
boot in interface ModuleControlstartParams - The start-up parametersStandardException - Thrown if the module fails to startMonitor,
ModuleFactoryprivate java.lang.String findDefaultBuiltinAlgorithm()
private CacheManager getPermissionsCache() throws StandardException
StandardExceptionprotected void setDependencyManager()
public DependencyManager getDependencyManager()
getDependencyManager in interface DataDictionaryDataDictionary.getDependencyManager()public void stop()
stop in interface ModuleControlMonitor,
ModuleFactorypublic Cacheable newCacheable(CacheManager cm)
newCacheable in interface CacheableFactorypublic int startReading(LanguageConnectionContext lcc) throws StandardException
DataDictionarystartReading in interface DataDictionarylcc - 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
DataDictionarydoneReading in interface DataDictionarymode - The mode that was returned by startReading().lcc - The LanguageConnectionContext to use.StandardException - Thrown on errorpublic void startWriting(LanguageConnectionContext lcc) throws StandardException
DataDictionarystartWriting in interface DataDictionarylcc - The LanguageConnectionContext to use.StandardException - Thrown on errorpublic void transactionFinished()
throws StandardException
DataDictionarytransactionFinished in interface DataDictionaryStandardException - Thrown on errorpublic int getCacheMode()
DataDictionarygetCacheMode in interface DataDictionaryprivate void setCacheMode(int newMode)
public DataDescriptorGenerator getDataDescriptorGenerator()
getDataDescriptorGenerator in interface DataDictionarypublic java.lang.String getAuthorizationDatabaseOwner()
getAuthorizationDatabaseOwner in interface DataDictionarypublic boolean usesSqlAuthorization()
DataDictionaryusesSqlAuthorization in interface DataDictionaryDataDictionary.usesSqlAuthorization()public int getCollationTypeOfSystemSchemas()
DataDictionarygetCollationTypeOfSystemSchemas in interface DataDictionaryDataDictionary.getCollationTypeOfSystemSchemas()public int getCollationTypeOfUserSchemas()
DataDictionarygetCollationTypeOfUserSchemas in interface DataDictionaryDataDictionary.getCollationTypeOfUserSchemas()public DataValueFactory getDataValueFactory()
getDataValueFactory in interface DataDictionarypublic ExecutionFactory getExecutionFactory()
getExecutionFactory in interface DataDictionaryprivate void getBuiltinSystemSchemas()
public PasswordHasher makePasswordHasher(java.util.Dictionary<?,?> props) throws StandardException
DataDictionarymakePasswordHasher in interface DataDictionaryprops - The persistent properties used to configure password hashing.StandardExceptionprivate byte[] generateRandomSalt(java.util.Dictionary props)
props - database properties that possibly specify the desired
length of the saltprivate int getIntProperty(java.util.Dictionary props,
java.lang.String key,
int defaultValue,
int minValue,
int maxValue)
props - database propertieskey - the key of the propertydefaultValue - which value to return if the property is not set,
or if the property value is not in the valid rangeminValue - lowest property value to acceptmaxValue - highest property value to acceptpublic SchemaDescriptor getSystemSchemaDescriptor() throws StandardException
getSystemSchemaDescriptor in interface DataDictionaryStandardException - Thrown on failurepublic SchemaDescriptor getSystemUtilSchemaDescriptor() throws StandardException
StandardException - Thrown on failurepublic SchemaDescriptor getSysIBMSchemaDescriptor() throws StandardException
getSysIBMSchemaDescriptor in interface DataDictionaryStandardException - Thrown on failurepublic SchemaDescriptor getDeclaredGlobalTemporaryTablesSchemaDescriptor() throws StandardException
getDeclaredGlobalTemporaryTablesSchemaDescriptor in interface DataDictionaryStandardException - Thrown on failurepublic boolean isSystemSchemaName(java.lang.String name)
throws StandardException
isSystemSchemaName in interface DataDictionaryname - StandardException - Thrown on failurepublic SchemaDescriptor getSchemaDescriptor(java.lang.String schemaName, TransactionController tc, boolean raiseError) throws StandardException
getSchemaDescriptor in interface DataDictionaryschemaName - 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
StandardExceptionprivate 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 DataDictionaryschemaId - The id of the schema we're interested in.tc - The transaction controller to us when scanning
SYSSCHEMASStandardException - Thrown on failurepublic SchemaDescriptor getSchemaDescriptor(UUID schemaId, int isolationLevel, TransactionController tc) throws StandardException
getSchemaDescriptor in interface DataDictionaryschemaId - 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 controllerStandardException - thrown on errorprivate SchemaDescriptor getSchemaDescriptorBody(UUID schemaId, int isolationLevel, TransactionController tc) throws StandardException
StandardExceptionpublic boolean existsSchemaOwnedBy(java.lang.String authid,
TransactionController tc)
throws StandardException
existsSchemaOwnedBy in interface DataDictionaryauthid - authorizationIdtc - TransactionControllerStandardExceptionpublic void addDescriptor(TupleDescriptor td, TupleDescriptor parent, int catalogNumber, boolean duplicatesAllowed, TransactionController tc) throws StandardException
DataDictionaryaddDescriptor in interface DataDictionarytd - 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.StandardExceptionDataDictionary.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 DataDictionaryStandardExceptionDataDictionary.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
DataDictionarydropRoleGrant in interface DataDictionaryroleName - The name of the role to dropgrantee - The granteegrantor - The grantortc - Transaction ControllerStandardException - 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 DataDictionaryschemaName - The name of the schema to droptc - TransactionController for the transactionStandardException - Thrown on errorpublic TableDescriptor getTableDescriptor(java.lang.String tableName, SchemaDescriptor schema, TransactionController tc) throws StandardException
getTableDescriptor in interface DataDictionarytableName - 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 tableStandardException - Thrown on failurepublic TableDescriptor getTableDescriptor(UUID tableID) throws StandardException
getTableDescriptor in interface DataDictionarytableID - The UUID of the table to get the descriptor forStandardException - Thrown on failureprotected TableDescriptor getUncachedTableDescriptor(UUID tableID) throws StandardException
tableID - The UUID of the table to get the descriptor forStandardException - 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 DataDictionarysd - descriptorStandardException - 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 orderableStandardException - on errorpublic void dropTableDescriptor(TableDescriptor td, SchemaDescriptor schema, TransactionController tc) throws StandardException
dropTableDescriptor in interface DataDictionarytd - 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 transactionStandardException - Thrown on errorpublic void updateLockGranularity(TableDescriptor td, SchemaDescriptor schema, char lockGranularity, TransactionController tc) throws StandardException
updateLockGranularity in interface DataDictionarytd - 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
StandardExceptionvoid upgradeSYSROUTINEPERMS_10_6(TransactionController tc) throws StandardException
StandardExceptionpublic ColumnDescriptor getColumnDescriptorByDefaultId(UUID uuid) throws StandardException
getColumnDescriptorByDefaultId in interface DataDictionaryuuid - The UUID of the defaultStandardException - 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 descriptorStandardException - Thrown on failurepublic void dropColumnDescriptor(UUID tableID, java.lang.String columnName, TransactionController tc) throws StandardException
dropColumnDescriptor in interface DataDictionarytableID - The UUID of the table to drop the column fromcolumnName - The name of the column to droptc - TransactionController for the transactionStandardException - Thrown on errorpublic void dropAllColumnDescriptors(UUID tableID, TransactionController tc) throws StandardException
dropAllColumnDescriptors in interface DataDictionarytableID - The UUID of the table from which to drop
all the column descriptorstc - TransactionController for the transactionStandardException - Thrown on errorpublic void dropAllTableAndColPermDescriptors(UUID tableID, TransactionController tc) throws StandardException
dropAllTableAndColPermDescriptors in interface DataDictionarytableID - The UUID of the table from which to drop
all the permission descriptorstc - TransactionController for the transactionStandardException - Thrown on errorpublic void updateSYSCOLPERMSforAddColumnToUserTable(UUID tableID, TransactionController tc) throws StandardException
updateSYSCOLPERMSforAddColumnToUserTable in interface DataDictionarytableID - The UUID of the table to which a column has been addedtc - TransactionController for the transactionStandardException - Thrown on errorpublic void updateSYSCOLPERMSforDropColumn(UUID tableID, TransactionController tc, ColumnDescriptor columnDescriptor) throws StandardException
updateSYSCOLPERMSforDropColumn in interface DataDictionarytableID - The UUID of the table from which a col has been droppedtc - TransactionController for the transactioncolumnDescriptor - Information about the dropped columnStandardException - 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 addingStandardException - Thrown on errorprivate void removePermEntryInCache(PermissionsDescriptor perm) throws StandardException
StandardExceptionpublic void dropAllRoutinePermDescriptors(UUID routineID, TransactionController tc) throws StandardException
dropAllRoutinePermDescriptors in interface DataDictionaryroutineID - The UUID of the routine from which to drop
all the permission descriptorstc - TransactionController for the transactionStandardException - Thrown on errorpublic void dropRoleGrantsByGrantee(java.lang.String grantee,
TransactionController tc)
throws StandardException
DataDictionarydropRoleGrantsByGrantee in interface DataDictionarygrantee - The granteetc - Transaction ControllerStandardException - 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 ControllerStandardException - Thrown on failurepublic void dropRoleGrantsByName(java.lang.String roleName,
TransactionController tc)
throws StandardException
DataDictionarydropRoleGrantsByName in interface DataDictionaryroleName - The role name grantedtc - Transaction ControllerStandardException - 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.StandardExceptionjava.util.HashMap<java.lang.String,java.util.List<RoleGrantDescriptor>> getRoleGrantGraph(TransactionController tc, boolean inverse) throws StandardException
tc - Transaction Controllerinverse - make graph on inverse grant relationStandardExceptionpublic RoleClosureIterator createRoleClosureIterator(TransactionController tc, java.lang.String role, boolean inverse) throws StandardException
DataDictionarydd.startReading()
or dd.startWriting() call.createRoleClosureIterator in interface DataDictionarytc - 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.StandardExceptionDataDictionary.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 DataDictionaryauthId - The authentication identifiertc - Transaction ControllerStandardException - Thrown on failureprivate void dropPermsByGrantee(java.lang.String authId,
TransactionController tc,
int catalog,
int indexNo,
int granteeColnoInIndex)
throws StandardException
StandardExceptionprivate boolean existsPermByGrantee(java.lang.String authId,
TransactionController tc,
int catalog,
int indexNo,
int granteeColnoInIndex)
throws StandardException
StandardExceptionprivate 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.StandardExceptionprivate 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 useStandardException - Thrown on failurepublic ViewDescriptor getViewDescriptor(UUID uuid) throws StandardException
getViewDescriptor in interface DataDictionaryuuid - The UUID for the viewStandardException - Thrown on errorpublic ViewDescriptor getViewDescriptor(TableDescriptor td) throws StandardException
getViewDescriptor in interface DataDictionarytd - 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 DataDictionaryvd - A descriptor for the view to be droppedtc - TransactionController to useStandardException - Thrown on errorprivate FileInfoDescriptor getFileInfoDescriptorIndex2Scan(UUID id) throws StandardException
StandardException - Thrown on failurepublic FileInfoDescriptor getFileInfoDescriptor(UUID id) throws StandardException
DataDictionarygetFileInfoDescriptor in interface DataDictionaryid - 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
DataDictionarygetFileInfoDescriptor in interface DataDictionarysd - 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
DataDictionarydropFileInfoDescriptor in interface DataDictionaryStandardException - Thrown on errorDataDictionary.dropFileInfoDescriptor(org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor)public SPSDescriptor getSPSDescriptor(UUID uuid) throws StandardException
getSPSDescriptor in interface DataDictionaryuuid - The UUIDStandardException - Thrown on failurevoid spsCacheEntryAdded(SPSDescriptor spsd)
void spsCacheEntryRemoved(SPSDescriptor spsd)
SPSDescriptor getUncachedSPSDescriptor(TableKey stmtKey) throws StandardException
stmtKey - The TableKey of the spsStandardException - Thrown on failureprotected SPSDescriptor getUncachedSPSDescriptor(UUID stmtId) throws StandardException
stmtId - The UUID of the stmt to get the descriptor forStandardException - 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 DataDictionarystmtName - the statement namesd - The SchemaDescriptorStandardException - 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 DataDictionarydescriptor - The descriptor to addtc - The transaction controllerStandardException - Thrown on errorprivate void addSPSParams(SPSDescriptor spsd, TransactionController tc) throws StandardException
StandardExceptionpublic DataTypeDescriptor[] getSPSParams(SPSDescriptor spsd, java.util.List<DataValueDescriptor> defaults) throws StandardException
getSPSParams in interface DataDictionaryspsd - sps descriptordefaults - list for storing column defaultsStandardException - Thrown on errorpublic void updateSPS(SPSDescriptor spsd, TransactionController tc, boolean recompile) throws StandardException
updateSPS in interface DataDictionaryspsd - The descriptor to addtc - The transaction controllerrecompile - Whether to recompile or invalidateStandardException - Thrown on errorpublic void invalidateAllSPSPlans()
throws StandardException
DataDictionaryinvalidateAllSPSPlans in interface DataDictionaryStandardException - Thrown on errorDataDictionary.invalidateAllSPSPlans(org.apache.derby.iapi.sql.conn.LanguageConnectionContext)public void invalidateAllSPSPlans(LanguageConnectionContext lcc) throws StandardException
DataDictionaryinvalidateAllSPSPlans in interface DataDictionaryStandardException - Thrown on errorDataDictionary.invalidateAllSPSPlans(org.apache.derby.iapi.sql.conn.LanguageConnectionContext)void clearSPSPlans()
throws StandardException
StandardException - Thrown on errorpublic void dropSPSDescriptor(SPSDescriptor descriptor, TransactionController tc) throws StandardException
dropSPSDescriptor in interface DataDictionarydescriptor - The descriptor to droptc - The TransactionController.StandardException - Thrown on failurepublic void dropSPSDescriptor(UUID uuid, TransactionController tc) throws StandardException
dropSPSDescriptor in interface DataDictionaryuuid - the statement uuidtc - The TransactionController.StandardException - Thrown on failurepublic java.util.List<SPSDescriptor> getAllSPSDescriptors() throws StandardException
getAllSPSDescriptors in interface DataDictionaryStandardException - Thrown on failureprivate ConstraintDescriptorList getAllConstraintDescriptors() throws StandardException
StandardException - Thrown on failurepublic int[] examineTriggerNodeAndCols(Visitable actionStmt, java.lang.String oldReferencingName, java.lang.String newReferencingName, java.lang.String triggerDefinition, int[] referencedCols, int[] referencedColsInTriggerAction, int actionOffset, TableDescriptor triggerTableDescriptor, int triggerEventMask, boolean createTriggerTime, java.util.List<int[]> replacements) throws StandardException
examineTriggerNodeAndCols in interface DataDictionaryactionStmt - This is needed to get access to the various nodes
generated by the Parser for the trigger action sql. These nodes will be
used to find REFERENCEs column nodes.oldReferencingName - The name specified by the user for REFERENCEs
to old row columnsnewReferencingName - The name specified by the user for REFERENCEs
to new row columnstriggerDefinition - The original trigger action text provided by
the user during CREATE TRIGGER time.referencedCols - Trigger is defined on these columns (will be null
in case of INSERT AND DELETE Triggers. Can also be null for DELETE
Triggers if UPDATE trigger is not defined on specific column(s))referencedColsInTriggerAction - what columns does the trigger
action reference through old/new transition variables (may be null)actionOffset - offset of start of action clausetriggerTableDescriptor - Table descriptor for trigger tabletriggerEventMask - TriggerDescriptor.TRIGGER_EVENT_XXXcreateTriggerTime - True if here for CREATE TRIGGER,
false if here because an invalidated row level trigger with
REFERENCEd columns has been fired and hence trigger action
sql associated with SPSDescriptor may be invalid too.StandardExceptionpublic java.lang.String getTriggerActionString(Visitable actionStmt, java.lang.String oldReferencingName, java.lang.String newReferencingName, java.lang.String triggerDefinition, int[] referencedCols, int[] referencedColsInTriggerAction, int actionOffset, TableDescriptor triggerTableDescriptor, int triggerEventMask, boolean createTriggerTime, java.util.List<int[]> replacements, int[] cols) throws StandardException
DataDictionarygetTriggerActionString in interface DataDictionaryactionStmt - This is needed to get access to the various nodes
generated by the Parser for the trigger action sql. These nodes will be
used to find REFERENCEs column nodes.oldReferencingName - The name specified by the user for REFERENCEs
to old row columnsnewReferencingName - The name specified by the user for REFERENCEs
to new row columnstriggerDefinition - The original trigger action text provided by
the user during CREATE TRIGGER time.referencedCols - Trigger is defined on these columns (will be null
in case of INSERT AND DELETE Triggers. Can also be null for DELETE
Triggers if UPDATE trigger is not defined on specific column(s))referencedColsInTriggerAction - what columns does the trigger
action reference through old/new transition variables (may be null)actionOffset - offset of start of action clausetriggerTableDescriptor - Table descriptor for trigger tabletriggerEventMask - TriggerDescriptor.TRIGGER_EVENT_XXXcreateTriggerTime - True if here for CREATE TRIGGER,
false if here because an invalidated row level trigger with
REFERENCEd columns has been fired and hence trigger action
sql associated with SPSDescriptor may be invalid too.replacements - a list that will be populated with objects that
describe how triggerDefinition has been transformed into
the returned SQL text. Each element in the list will contain four
integers. The first two describe the begin and end offset of the
replaced text in the triggerDefinition. The last two describe
the begin and end offset of the replacement text in the returned
string. The begin offsets are inclusive, whereas the end offsets are
exclusive. The list can be null if the caller does not care
about this information.StandardExceptionprivate static java.util.SortedSet<ColumnReference> getTransitionVariables(Visitable node, java.lang.String oldReferencingName, java.lang.String newReferencingName) throws StandardException
node - the node in which to look for transition variablesoldReferencingName - the name of the old transition variablenewReferencingName - the name of the new transition variableStandardExceptionprivate static boolean isTransitionVariable(TableName tableName, java.lang.String oldReferencingName, java.lang.String newReferencingName)
tableName - the table name to checkoldReferencingName - the name of the old transition variablenewReferencingName - the name of the new transition variabletrue if the table name is a transition variable,
false otherwiseprivate int[] justTheRequiredColumns(int[] columnsArrary,
TableDescriptor triggerTableDescriptor)
private void checkInvalidTriggerReference(java.lang.String tableName,
java.lang.String oldReferencingName,
java.lang.String newReferencingName,
int triggerEventMask)
throws StandardException
StandardExceptionprivate java.lang.String genColumnReferenceSQL(TableDescriptor td, java.lang.String colName, java.lang.String tabName, boolean isOldTable, int colPositionInRuntimeResultSet) throws StandardException
StandardExceptionpublic TriggerDescriptor getTriggerDescriptor(UUID uuid) throws StandardException
getTriggerDescriptor in interface DataDictionaryuuid - The UUIDStandardException - Thrown on failurepublic TriggerDescriptor getTriggerDescriptor(java.lang.String name, SchemaDescriptor sd) throws StandardException
getTriggerDescriptor in interface DataDictionaryname - The sps name.sd - The schema descriptor.StandardException - Thrown on failurepublic TriggerDescriptorList getTriggerDescriptors(TableDescriptor td) throws StandardException
getTriggerDescriptors in interface DataDictionarytd - 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 updateStandardException - Thrown on failurepublic void dropTriggerDescriptor(TriggerDescriptor descriptor, TransactionController tc) throws StandardException
dropTriggerDescriptor in interface DataDictionarydescriptor - 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 DataDictionarytriggerd - 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 useStandardException - Thrown on failurepublic ConstraintDescriptor getConstraintDescriptor(UUID uuid) throws StandardException
getConstraintDescriptor in interface DataDictionaryuuid - The UUIDStandardException - Thrown on failurepublic ConstraintDescriptor getConstraintDescriptor(java.lang.String constraintName, UUID schemaID) throws StandardException
getConstraintDescriptor in interface DataDictionaryconstraintName - Constraint name.schemaID - The schema UUIDStandardException - Thrown on failurepublic java.util.List<StatisticsDescriptor> getStatisticsDescriptors(TableDescriptor td) throws StandardException
NOTE: As opposed to most other data dictionary lookups, this operation is performed with isolation level READ_UNCOMMITTED. The reason is to avoid deadlocks with inserts into the statistics system table.
getStatisticsDescriptors in interface DataDictionarytd - TableDescriptor for which I need statisticsStandardExceptionpublic ConstraintDescriptorList getConstraintDescriptors(TableDescriptor td) throws StandardException
getConstraintDescriptors in interface DataDictionarytd - The table descriptor. If null,
all constraint descriptors are returned.StandardException - Thrown on failurepublic ConstraintDescriptorList getActiveConstraintDescriptors(ConstraintDescriptorList cdl) throws StandardException
getActiveConstraintDescriptors in interface DataDictionarycdl - 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 DataDictionaryconstraint - the constraint to checkStandardException - Thrown on failurepublic ConstraintDescriptor getConstraintDescriptor(TableDescriptor td, UUID uuid) throws StandardException
getConstraintDescriptor in interface DataDictionarytd - 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 DataDictionarytd - The table descriptor.uuid - The UUID for the constraintStandardException - Thrown on failurepublic ConstraintDescriptor getConstraintDescriptorByName(TableDescriptor td, SchemaDescriptor sd, java.lang.String constraintName, boolean forUpdate) throws StandardException
getConstraintDescriptorByName in interface DataDictionarytd - The table descriptor.sd - The schema descriptor for the constraintconstraintName - The constraint name.forUpdate - Whether or not access is for updateStandardException - Thrown on failureprivate void getConstraintDescriptorsScan(TableDescriptor td, boolean forUpdate) throws StandardException
td - The TableDescriptor.forUpdate - Whether or not to open scan for updateStandardException - 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 updateStandardException - Thrown on errorprotected TupleDescriptor getConstraintDescriptorViaHeap(ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, ConstraintDescriptorList 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 descriptorStandardException - Thrown on errorpublic TableDescriptor getConstraintTableDescriptor(UUID constraintId) throws StandardException
getConstraintTableDescriptor in interface DataDictionaryconstraintId - The id of the constraintStandardException - Thrown on errorpublic ConstraintDescriptorList getForeignKeys(UUID constraintId) throws StandardException
getForeignKeys in interface DataDictionaryconstraintId - The id of the referenced constraintStandardException - Thrown on errorpublic java.util.List<UUID> getConstraints(UUID uuid, int indexId, int columnNum) throws StandardException
uuid - The id of the constraintindexId - The index id in SYS.SYSCONSTRAINTScolumnNum - The column to retrieveStandardException - Thrown on errorpublic void addConstraintDescriptor(ConstraintDescriptor descriptor, TransactionController tc) throws StandardException
addConstraintDescriptor in interface DataDictionarydescriptor - The descriptor to addtc - The transaction controllerStandardException - Thrown on errorpublic void updateConstraintDescriptor(ConstraintDescriptor cd, UUID formerUUID, int[] colsToSet, TransactionController tc) throws StandardException
updateConstraintDescriptor in interface DataDictionarycd - The Constraint descriptorformerUUID - 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 integers of columns to be modified,
1 based. May be null (all columns).tc - The TransactionController to useStandardException - Thrown on failurepublic void dropConstraintDescriptor(ConstraintDescriptor descriptor, TransactionController tc) throws StandardException
dropConstraintDescriptor in interface DataDictionarydescriptor - The descriptor to droptc - The TransactionControllerStandardException - Thrown on errorpublic void dropAllConstraintDescriptors(TableDescriptor table, TransactionController tc) throws StandardException
dropAllConstraintDescriptors in interface DataDictionarytable - The table from which to drop all
constraint descriptorstc - The TransactionControllerStandardException - Thrown on errorpublic SubKeyConstraintDescriptor getSubKeyConstraint(UUID constraintId, int type) throws StandardException
getSubKeyConstraint in interface DataDictionaryconstraintId - 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 TransactionControllerStandardException - Thrown on failureprivate void dropSubKeyConstraint(ConstraintDescriptor constraint, TransactionController tc) throws StandardException
constraint - the constrainttc - The TransactionControllerStandardException - 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 TransactionControllerStandardException - Thrown on failurepublic java.util.Hashtable<java.lang.Long,ConglomerateDescriptor> hashAllConglomerateDescriptorsByNumber(TransactionController tc) throws StandardException
hashAllConglomerateDescriptorsByNumber in interface DataDictionarytc - TransactionController for the transactionStandardException - Thrown on failurepublic java.util.Hashtable<UUID,TableDescriptor> hashAllTableDescriptorsByTableId(TransactionController tc) throws StandardException
hashAllTableDescriptorsByTableId in interface DataDictionarytc - TransactionController for the transactionStandardException - Thrown on failurepublic ConglomerateDescriptor getConglomerateDescriptor(UUID uuid) throws StandardException
getConglomerateDescriptor in interface DataDictionaryuuid - The UUIDStandardException - Thrown on failurepublic ConglomerateDescriptor[] getConglomerateDescriptors(UUID uuid) throws StandardException
getConglomerateDescriptors in interface DataDictionaryuuid - The UUIDStandardException - Thrown on failurepublic ConglomerateDescriptor getConglomerateDescriptor(long conglomerateNumber) throws StandardException
getConglomerateDescriptor in interface DataDictionaryconglomerateNumber - The conglomerate number.StandardException - Thrown on failurepublic ConglomerateDescriptor[] getConglomerateDescriptors(long conglomerateNumber) throws StandardException
getConglomerateDescriptors in interface DataDictionaryconglomerateNumber - The number for the conglomerate
we're interested inStandardException - 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 DataDictionaryindexName - 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 DataDictionaryconglomerate - The ConglomerateDescriptor for the conglomeratetc - TransactionController for the transactionStandardException - Thrown on failurepublic void dropAllConglomerateDescriptors(TableDescriptor td, TransactionController tc) throws StandardException
dropAllConglomerateDescriptors in interface DataDictionarytd - The TableDescriptor of the tabletc - TransactionController for the transactionStandardException - Thrown on failurepublic void updateConglomerateDescriptor(ConglomerateDescriptor cd, long conglomerateNumber, TransactionController tc) throws StandardException
updateConglomerateDescriptor in interface DataDictionarycd - The ConglomerateDescriptorconglomerateNumber - The new conglomerate numbertc - The TransactionController to useStandardException - Thrown on failurepublic void updateSystemSchemaAuthorization(java.lang.String aid,
TransactionController tc)
throws StandardException
aid - AuthorizationID of Database Ownertc - TransactionController to useStandardException - 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 useStandardException - Thrown on failurepublic void updateConglomerateDescriptor(ConglomerateDescriptor[] cds, long conglomerateNumber, TransactionController tc) throws StandardException
updateConglomerateDescriptor in interface DataDictionarycds - The array of ConglomerateDescriptorsconglomerateNumber - The new conglomerate numbertc - The TransactionController to useStandardException - Thrown on failurepublic java.util.List<DependencyDescriptor> getDependentsDescriptorList(java.lang.String dependentID) throws StandardException
getDependentsDescriptorList in interface DataDictionarydependentID - The ID of the dependent we're interested inStandardException - Thrown on failurepublic java.util.List<DependencyDescriptor> getProvidersDescriptorList(java.lang.String providerID) throws StandardException
getProvidersDescriptorList in interface DataDictionaryproviderID - The ID of the provider we're interested inStandardException - Thrown on failurepublic java.util.List<TupleDescriptor> getAllDependencyDescriptorsList() throws StandardException
getAllDependencyDescriptorsList in interface DataDictionaryStandardException - Thrown on failurepublic void dropStoredDependency(DependencyDescriptor dd, TransactionController tc) throws StandardException
dropStoredDependency in interface DataDictionarydd - The DependencyDescriptor.tc - TransactionController for the transactionStandardException - Thrown on failurepublic void dropDependentsStoredDependencies(UUID dependentsUUID, TransactionController tc) throws StandardException
dropDependentsStoredDependencies in interface DataDictionarydependentsUUID - Dependent's uuidtc - TransactionController for the transactionStandardException - Thrown on failurepublic void dropDependentsStoredDependencies(UUID dependentsUUID, TransactionController tc, boolean wait) throws StandardException
DataDictionarydropDependentsStoredDependencies in interface DataDictionarydependentsUUID - 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 DataDictionarypublic AliasDescriptor getAliasDescriptorForUDT(TransactionController tc, DataTypeDescriptor dtd) throws StandardException
getAliasDescriptorForUDT in interface DataDictionarytc - The transaction to use: if null, use the compilation transactiondtd - The UDT's type descriptorStandardExceptionpublic AliasDescriptor getAliasDescriptor(UUID uuid) throws StandardException
getAliasDescriptor in interface DataDictionaryuuid - The UUIDStandardException - Thrown on failurepublic AliasDescriptor getAliasDescriptor(java.lang.String schemaId, java.lang.String aliasName, char nameSpace) throws StandardException
getAliasDescriptor in interface DataDictionaryschemaId - schema identifieraliasName - The alias name.nameSpace - The alias type.StandardException - Thrown on failurepublic java.util.List<AliasDescriptor> getRoutineList(java.lang.String schemaID, java.lang.String routineName, char nameSpace) throws StandardException
getRoutineList in interface DataDictionaryStandardExceptionpublic void dropAliasDescriptor(AliasDescriptor ad, TransactionController tc) throws StandardException
dropAliasDescriptor in interface DataDictionaryad - The AliasDescriptor to droptc - The TransactionControllerStandardException - Thrown on failurepublic void updateUser(UserDescriptor newDescriptor, TransactionController tc) throws StandardException
DataDictionaryupdateUser in interface DataDictionarynewDescriptor - New values for columns in the SYSUSERS row.tc - The TransactionController to useStandardException - Thrown on failurepublic UserDescriptor getUser(java.lang.String userName) throws StandardException
DataDictionarygetUser in interface DataDictionaryuserName - Name of the user whose credentials we want.StandardException - Thrown on failurepublic void dropUser(java.lang.String userName,
TransactionController tc)
throws StandardException
DataDictionarydropUser in interface DataDictionaryuserName - The user to drop.tc - The TransactionControllerStandardException - Thrown on failureprivate void loadDictionaryTables(TransactionController tc, java.util.Properties startParams) throws StandardException
tc - TransactionControllerStandardException - Thrown on errorpublic void resetDatabaseOwner(TransactionController tc) throws StandardException
tc - TransactionControllerStandardException - Thrown on errorprivate void loadCatalogs(TabInfoImpl[] catalogArray) throws StandardException
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 - catalogNumberStandardExceptionprotected void upgradeJarStorage(TransactionController tc) throws StandardException
tc - TransactionController to use.StandardExceptionprivate 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 controllerStandardException - 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 controllerStandardException - Standard Derby error policyvoid upgrade_SYSCOLUMNS_AUTOINCCYCLE(TransactionController tc) throws StandardException
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 controllerStandardException - 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 controllerStandardException - Standard Derby error policyprivate UUID getUUIDForCoreTable(java.lang.String tableName, java.lang.String schemaUUID, TransactionController tc) throws StandardException
tableName - Name of the tableschemaUUID - UUID of schematc - TransactionController to userStandardException - 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 valuesStandardException - 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
DataDictionarycomputeAutoincRowLocations in interface DataDictionarytc - TransactionControler to use to compute the row location.td - TableDescriptorStandardException - if an error happensDataDictionary.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
DataDictionarygetSetAutoincrementValue in interface DataDictionaryrl - 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.StandardExceptionDataDictionary.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
StandardExceptionprivate void initSystemIndexVariables(TabInfoImpl ti, int indexNumber) throws StandardException
StandardExceptionprotected void populateSYSDUMMY1(TransactionController tc) throws StandardException
StandardException - Standard Derby error policypublic void clearCaches()
throws StandardException
clearCaches in interface DataDictionaryStandardException - Standard Derby error policypublic void clearCaches(boolean clearSequenceCaches)
throws StandardException
clearCaches in interface DataDictionaryStandardException - Standard Derby error policypublic void clearSequenceCaches()
throws StandardException
clearSequenceCaches in interface DataDictionaryStandardException - Standard Derby error policyprivate void addSystemTableToDictionary(TabInfoImpl ti, SchemaDescriptor sd, TransactionController tc, DataDescriptorGenerator ddg) throws StandardException
StandardExceptionprivate 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 inStandardException - 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 createConglomerateStandardException - Standard Derby error policy.private static SQLChar getIDValueAsCHAR(UUID uuid)
public void initializeCatalogInfo()
throws StandardException
StandardException - Thrown on errorprivate void initializeCoreInfo()
throws StandardException
StandardExceptionprivate void initializeNoncoreInfo()
public TransactionController getTransactionCompile() throws StandardException
StandardException - Thrown on errorpublic TransactionController getTransactionExecute() throws StandardException
StandardException - Thrown on errorprivate <T extends TupleDescriptor> T getDescriptorViaIndex(int indexId, ExecIndexRow keyRow, ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, java.util.List<? super T> list, java.lang.Class<T> returnType, 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 descriptorreturnType - The type of descriptor to returnforUpdate - Whether or not to open the index for update.StandardException - Thrown on errorprivate <T extends TupleDescriptor> T getDescriptorViaIndex(int indexId, ExecIndexRow keyRow, ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, java.util.List<? super T> list, java.lang.Class<T> returnType, 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 descriptorreturnType - The type of descriptor to returnforUpdate - 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 controllerStandardException - Thrown on error.private <T extends TupleDescriptor> T getDescriptorViaIndexMinion(int indexId, ExecIndexRow keyRow, ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, java.util.List<? super T> list, java.lang.Class<T> returnType, boolean forUpdate, int isolationLevel, TransactionController tc) throws StandardException
StandardExceptionprivate void debugGenerateInfo(java.lang.StringBuffer strbuf,
TransactionController tc,
ConglomerateController heapCC,
TabInfoImpl ti,
int indexId)
protected <T extends TupleDescriptor> T getDescriptorViaHeap(FormatableBitSet columns, ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, java.util.List<? super T> list, java.lang.Class<T> returnType) throws StandardException
columns - which columns to fetch from the system
table, or null to fetch all columnsscanQualifiers - qualifiersti - The TabInfoImpl to useparentTupleDescriptor - The parentDescriptor, if applicable.list - The list to build, if supplied.
If null, then caller expects a single descriptorreturnType - The type of descriptor to look forStandardException - Thrown on errorprivate TabInfoImpl getNonCoreTI(int catalogNumber) throws StandardException
catalogNumber - The index into noncoreTable[].StandardException - Thrown on errorprotected TabInfoImpl getNonCoreTIByNumber(int catalogNumber) throws StandardException
StandardExceptionprotected void initSystemIndexVariables(TabInfoImpl ti) throws StandardException
StandardExceptionprivate void clearNoncoreTable(int nonCoreNum)
private 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 heapStandardException - Thrown on errorpublic int getEngineType()
getEngineType in interface DataDictionarypublic long getSYSCOLUMNSHeapConglomerateNumber()
void addSYSCOLUMNSIndex2Property(TransactionController tc, long index2ConglomerateNumber)
private long getBootParameter(java.util.Properties startParams,
java.lang.String key,
boolean required)
throws StandardException
StandardExceptionpublic java.lang.String getSystemSQLName()
getSystemSQLName in interface DataDictionaryprivate 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 DataDictionarytc - 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 DescriptorStandardExceptionprivate 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.public void computeSequenceRowLocation(TransactionController tc, java.lang.String sequenceIDstring, RowLocation[] rowLocation, SequenceDescriptor[] sequenceDescriptor) throws StandardException
computeSequenceRowLocation in interface DataDictionarytc - 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 descriptorStandardException - thrown on failure.public boolean updateCurrentSequenceValue(TransactionController tc, RowLocation rowLocation, boolean wait, java.lang.Long oldValue, java.lang.Long newValue) throws StandardException
updateCurrentSequenceValue in interface DataDictionarytc - 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
DataDictionarygetCurrentValueAndAdvance in interface DataDictionarysequenceUUIDstring - 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 java.lang.Long peekAtIdentity(java.lang.String schemaName,
java.lang.String tableName)
throws StandardException
DataDictionaryPeek at the next value which will be returned by an identity generator.
peekAtIdentity in interface DataDictionaryStandardExceptionpublic java.lang.Long peekAtSequence(java.lang.String schemaName,
java.lang.String sequenceName)
throws StandardException
DataDictionaryPeek at the next value which will be returned by a sequence generator.
peekAtSequence in interface DataDictionaryStandardExceptionpublic BulkInsertCounter getBulkInsertCounter(java.lang.String sequenceUUIDString, boolean restart) throws StandardException
DataDictionarygetBulkInsertCounter in interface DataDictionarysequenceUUIDString - UUID of the sequence which backs the identity column.restart - True if the counter should be re-initialized to its start position.StandardExceptionpublic void flushBulkInsertCounter(java.lang.String sequenceUUIDString,
BulkInsertCounter bic)
throws StandardException
DataDictionaryflushBulkInsertCounter in interface DataDictionarysequenceUUIDString - UUID of the sequence which backs the identity column.bic - the BulkInsertCounter which generates identities for bulk insertStandardExceptionpublic RowLocation getRowLocationTemplate(LanguageConnectionContext lcc, TableDescriptor td) throws StandardException
getRowLocationTemplate in interface DataDictionaryStandardExceptionpublic 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.StandardExceptionpublic void dropStatisticsDescriptors(UUID tableUUID, UUID referenceUUID, TransactionController tc) throws StandardException
DataDictionarydropStatisticsDescriptors in interface DataDictionarytableUUID - UUID of the tablereferenceUUID - UUID of the index. This can be null.tc - Transcation Controller to use.StandardExceptionDataDictionary.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 DataDictionaryrequiredMajorVersion - Data Dictionary major versionfeature - Non-null to throw an error, null to return the state of the version match.StandardExceptionpublic boolean isReadOnlyUpgrade()
DataDictionaryisReadOnlyUpgrade in interface DataDictionarytrue if the stored prepared statements are invalid
because of an upgrade and the database is read only, false
otherwisevoid setReadOnlyUpgrade()
void createSystemSps(TransactionController tc) throws StandardException
StandardExceptionprotected void createSPSSet(TransactionController tc, boolean net, UUID schemaID) throws StandardException
StandardExceptionprivate 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, boolean hasVarargs, TypeDescriptor return_type, java.util.HashSet<java.lang.String> 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 proceduresStandardException - 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, boolean hasVarargs, TypeDescriptor return_type, java.util.HashSet<java.lang.String> 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 TransactionControllerStandardException - Standard exception policy.private final void create_SYSCS_procedures(TransactionController tc, java.util.HashSet<java.lang.String> 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 onStandardException - Standard exception policy.protected final void create_SYSIBM_procedures(TransactionController tc, java.util.HashSet<java.lang.String> 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 grantorStandardException - 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 grantorStandardException - 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 grantorStandardException - Standard exception policy.void create_10_1_system_procedures(TransactionController tc, java.util.HashSet<java.lang.String> 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<java.lang.String> 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<java.lang.String> 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<java.lang.String> 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<java.lang.String> newlyCreatedRoutines) throws StandardException
tc - an instance of the TransactionController.StandardException - Standard exception policy.void create_10_3_system_procedures(TransactionController tc, java.util.HashSet<java.lang.String> 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<java.lang.String> 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.void create_10_9_system_procedures(TransactionController tc, java.util.HashSet<java.lang.String> newlyCreatedRoutines) throws StandardException
Create system procedures that are part of the SYSCS_UTIL schema added in version 10.9. These include the procedures for managing NATIVE credentials. See DERBY-866.
tc - an instance of the Transaction Controller.newlyCreatedRoutines - set of routines we are creating (used to add permissions later on)StandardExceptionvoid create_10_10_system_procedures(TransactionController tc, java.util.HashSet<java.lang.String> newlyCreatedRoutines) throws StandardException
Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.10.
tc - an instance of the Transaction Controller.newlyCreatedRoutines - set of routines we are creating (used to add permissions later on)StandardExceptionvoid create_10_11_system_procedures(TransactionController tc, java.util.HashSet<java.lang.String> newlyCreatedRoutines) throws StandardException
Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.11.
tc - an instance of the Transaction Controller.newlyCreatedRoutines - set of routines we are creating (used to add permissions later on)StandardExceptionvoid create_10_12_system_procedures(TransactionController tc, java.util.HashSet<java.lang.String> newlyCreatedRoutines) throws StandardException
Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.12.
tc - an instance of the Transaction Controller.newlyCreatedRoutines - set of routines we are creating (used to add permissions later on)StandardExceptionvoid create_10_13_system_procedures(TransactionController tc, java.util.HashSet<java.lang.String> newlyCreatedRoutines) throws StandardException
Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.13.
tc - an instance of the Transaction Controller.newlyCreatedRoutines - set of routines we are creating (used to add permissions later on)StandardExceptionprivate final java.util.Properties getQueryDescriptions(boolean net)
public final java.util.Properties run()
run in interface java.security.PrivilegedAction<java.util.Properties>private static <T> java.util.List<T> newSList()
public TablePermsDescriptor getTablePermissions(UUID tableUUID, java.lang.String authorizationId) throws StandardException
getTablePermissions in interface DataDictionarytableUUID - authorizationId - The user nameStandardExceptionpublic TablePermsDescriptor getTablePermissions(UUID tablePermsUUID) throws StandardException
DataDictionarygetTablePermissions in interface DataDictionaryStandardExceptionprivate java.lang.Object getPermissions(PermissionsDescriptor key) throws StandardException
StandardExceptionpublic ColPermsDescriptor getColumnPermissions(UUID colPermsUUID) throws StandardException
DataDictionarygetColumnPermissions in interface DataDictionaryStandardExceptionpublic ColPermsDescriptor getColumnPermissions(UUID tableUUID, int privType, boolean forGrant, java.lang.String authorizationId) throws StandardException
getColumnPermissions in interface DataDictionarytableUUID - privType - (as int) Authorizer.SELECT_PRIV, Authorizer.UPDATE_PRIV, or Authorizer.REFERENCES_PRIVforGrant - authorizationId - The user nameStandardExceptionpublic ColPermsDescriptor getColumnPermissions(UUID tableUUID, java.lang.String privTypeStr, boolean forGrant, java.lang.String authorizationId) throws StandardException
getColumnPermissions in interface DataDictionarytableUUID - privTypeStr - (as String) Authorizer.SELECT_PRIV, Authorizer.UPDATE_PRIV, or Authorizer.REFERENCES_PRIVforGrant - authorizationId - The user nameStandardExceptionpublic RoutinePermsDescriptor getRoutinePermissions(UUID routineUUID, java.lang.String authorizationId) throws StandardException
getRoutinePermissions in interface DataDictionaryroutineUUID - authorizationId - The user's nameStandardExceptionpublic RoutinePermsDescriptor getRoutinePermissions(UUID routinePermsUUID) throws StandardException
DataDictionarygetRoutinePermissions in interface DataDictionaryStandardExceptionpublic boolean addRemovePermissionsDescriptor(boolean add,
PermissionsDescriptor perm,
java.lang.String grantee,
TransactionController tc)
throws StandardException
addRemovePermissionsDescriptor in interface DataDictionaryadd - if true then the permission is added, if false the permission is removedperm - grantee - tc - StandardExceptionTablePermsDescriptor getUncachedTablePermsDescriptor(TablePermsDescriptor key) throws StandardException
StandardExceptionColPermsDescriptor getUncachedColPermsDescriptor(ColPermsDescriptor key) throws StandardException
StandardExceptionprivate <T extends PermissionsDescriptor> T getUncachedPermissionsDescriptor(int catalogNumber, int indexNumber, T key, java.lang.Class<T> returnType) throws StandardException
StandardExceptionRoutinePermsDescriptor getUncachedRoutinePermsDescriptor(RoutinePermsDescriptor key) throws StandardException
StandardExceptionpublic java.lang.String getVTIClass(TableDescriptor td, boolean asTableFunction) throws StandardException
DataDictionarygetVTIClass in interface DataDictionarytd - 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".StandardExceptionDataDictionary.getVTIClass(TableDescriptor, boolean)public java.lang.String getBuiltinVTIClass(TableDescriptor td, boolean asTableFunction) throws StandardException
DataDictionarygetBuiltinVTIClass in interface DataDictionarytd - 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".StandardExceptionDataDictionary.getBuiltinVTIClass(TableDescriptor, boolean)public RoleGrantDescriptor getRoleGrantDescriptor(UUID uuid) throws StandardException
DataDictionarygetRoleGrantDescriptor in interface DataDictionaryStandardException - Thrown on errorDataDictionary.getRoleGrantDescriptor(UUID)public RoleGrantDescriptor getRoleDefinitionDescriptor(java.lang.String roleName) throws StandardException
getRoleDefinitionDescriptor in interface DataDictionaryroleName - 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 DataDictionaryroleName - The name of the role we're interested in.grantee - The granteegrantor - The grantorStandardException - 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 DataDictionaryauthId - grantee for which a grant exists or nottc - TransactionController for the transactionStandardExceptionprivate void dropJDBCMetadataSPSes(TransactionController tc) throws StandardException
tc - the xactStandardExceptionpublic void updateMetadataSPSes(TransactionController tc) throws StandardException
updateMetadataSPSes in interface DataDictionarytc - the xactStandardExceptionpublic void dropSequenceDescriptor(SequenceDescriptor descriptor, TransactionController tc) throws StandardException
dropSequenceDescriptor in interface DataDictionarydescriptor - The descriptor to droptc - The TransactionController.StandardException - Thrown on failurepublic SequenceDescriptor getSequenceDescriptor(UUID uuid) throws StandardException
DataDictionarygetSequenceDescriptor in interface DataDictionaryuuid - uuid of the sequenceStandardException - errorpublic SequenceDescriptor getSequenceDescriptor(SchemaDescriptor sd, java.lang.String sequenceName) throws StandardException
getSequenceDescriptor in interface DataDictionarysequenceName - The sequence name, guaranteed to be unique only within its schema.sd - The schema descriptor.StandardException - Thrown on failureprivate void putSequenceID(SequenceDescriptor sd) throws StandardException
StandardExceptionprivate void dropSequenceID(SequenceDescriptor sd) throws StandardException
StandardExceptionprivate java.lang.String getSequenceID(java.lang.String schemaName,
java.lang.String sequenceName)
throws StandardException
Get the uuid string of a sequence given its schema and sequence name.
StandardExceptionPermDescriptor getUncachedGenericPermDescriptor(PermDescriptor key) throws StandardException
StandardExceptionpublic PermDescriptor getGenericPermissions(UUID objectUUID, java.lang.String objectType, java.lang.String privilege, java.lang.String granteeAuthId) throws StandardException
getGenericPermissions in interface DataDictionaryobjectUUID - 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 objectStandardExceptionpublic PermDescriptor getGenericPermissions(UUID permUUID) throws StandardException
getGenericPermissions in interface DataDictionarypermUUID - StandardExceptionpublic void dropAllPermDescriptors(UUID objectID, TransactionController tc) throws StandardException
dropAllPermDescriptors in interface DataDictionaryobjectID - The UUID of the object from which to drop
all the permission descriptorstc - TransactionController for the transactionStandardException - Thrown on errorpublic IndexStatisticsDaemon getIndexStatsRefresher(boolean asDaemon)
getIndexStatsRefresher in interface DataDictionaryasDaemon - whether the usage is automatic (true) or
explicit (false)null if
disabled. If asDaemon is false, an instance will
always be returned.public void disableIndexStatsRefresher()
If the daemon is disabled, it can only be enabled again by rebooting the database. Note that this method concerns diabling the daemon at runtime, and only the automatic updates of statistics. If wanted, the user would disable the daemon at boot-time by setting a property (system-wide or database property).
Usage note: This method was added to allow the index refresher itself to notify the data dictionary that it should be disabled. This only happens if the refresher/daemon experiences severe errors, or a large amount of errors. It would then disable itself to avoid eating up system resources and potentially cause side-effects due to the errors.
disableIndexStatsRefresher in interface DataDictionarypublic boolean doCreateIndexStatsRefresher()
The only reason not to create an index statistics refresher is if one already exists.
doCreateIndexStatsRefresher in interface DataDictionarytrue if an index statistics refresher should be created,
false if one already exists.public void createIndexStatsRefresher(Database db, java.lang.String dbName)
The index statistics refresher is used to create and refresh index cardinality statistics, either automatically or on user demand (i.e. by invoking SYSCS_UTIL.SYSCS_UPDATE_STATISTICS).
createIndexStatsRefresher in interface DataDictionarydb - the database object associated with this data dictionarydbName - the name of the databasepublic DependableFinder getDependableFinder(int formatId)
DataDictionaryDependableFinder instance.getDependableFinder in interface DataDictionaryformatId - the format idDependables with the
specified format idpublic DependableFinder getColumnDependableFinder(int formatId, byte[] columnBitMap)
DataDictionaryDependableFinder instance for referenced columns in
a table.getColumnDependableFinder in interface DataDictionaryformatId - the format idcolumnBitMap - byte array encoding the bitmap of referenced columnsDependables with the
specified format idvoid createIdentitySequences(TransactionController tc) throws StandardException
StandardExceptionprivate void createIdentitySequence(TableDescriptor td, ColumnDescriptor cd, TransactionController tc) throws StandardException
StandardExceptionprivate static ContextService getContextService()
private static Context getContextOrNull(java.lang.String contextID)
private static Context getContext(java.lang.String contextID)
static ModuleFactory getMonitor()
private static java.lang.Object startSystemModule(java.lang.String factoryInterface)
throws StandardException
StandardExceptionprivate static java.lang.Object bootServiceModule(boolean create,
java.lang.Object serviceModule,
java.lang.String factoryInterface,
java.util.Properties properties)
throws StandardException
StandardExceptionprivate static java.lang.Object findServiceModule(java.lang.Object serviceModule,
java.lang.String factoryInterface)
throws StandardException
StandardExceptionApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.