Top Description Fields Constructors Methods
org.apache.derby.impl.sql.catalog

public final Class DataDictionaryImpl

extends Object
implements DataDictionary, CacheableFactory, ModuleControl, ModuleSupportable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.monitor.ModuleSupportable, org.apache.derby.iapi.services.monitor.ModuleControl, org.apache.derby.iapi.services.cache.CacheableFactory, org.apache.derby.iapi.sql.dictionary.DataDictionary
Annotations
@SuppressWarnings:UseOfObsoleteCollectionType
Imports
java.io.File, .IOException, .InputStream, java.security.MessageDigest, .NoSuchAlgorithmException, .SecureRandom, java.sql.ParameterMetaData, .Types, java.util.Arrays, .ArrayList, .Calendar, .Collections, .Dictionary, .Enumeration, .GregorianCalendar, .HashMap, .HashSet, .Hashtable, .Iterator, .LinkedList, .List, .Map, .Properties, .SortedSet, org.apache.derby.catalog.AliasInfo, .DefaultInfo, .DependableFinder, .TypeDescriptor, .UUID, org.apache.derby.catalog.types.BaseTypeIdImpl, .RoutineAliasInfo, org.apache.derby.iapi.db.Database, org.apache.derby.shared.common.error.StandardException, .MessageUtils, org.apache.derby.shared.common.reference.Attribute, .EngineType, .Limits, .Property, .SQLState, org.apache.derby.iapi.services.cache.CacheFactory, .CacheManager, .Cacheable, .CacheableFactory, org.apache.derby.iapi.services.context.ContextManager, .Context, .ContextService, org.apache.derby.iapi.services.daemon.IndexStatisticsDaemon, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.services.locks.C_LockFactory, .CompatibilitySpace, .LockFactory, .ShExLockable, .ShExQual, org.apache.derby.iapi.services.monitor.ModuleControl, .ModuleFactory, .ModuleSupportable, .Monitor, org.apache.derby.iapi.services.property.PropertyUtil, org.apache.derby.shared.common.sanity.AssertFailure, .SanityManager, org.apache.derby.iapi.services.uuid.UUIDFactory, org.apache.derby.iapi.sql.compile.Visitable, org.apache.derby.iapi.sql.conn.Authorizer, .LanguageConnectionContext, .LanguageConnectionFactory, org.apache.derby.iapi.sql.depend.DependencyManager, org.apache.derby.iapi.sql.dictionary.AliasDescriptor, .BulkInsertCounter, .CatalogRowFactory, .CheckConstraintDescriptor, .ColPermsDescriptor, .ColumnDescriptor, .ColumnDescriptorList, .ConglomerateDescriptor, .ConglomerateDescriptorList, .ConstraintDescriptor, .ConstraintDescriptorList, .DataDescriptorGenerator, .DataDictionary, .DefaultDescriptor, .DependencyDescriptor, .FileInfoDescriptor, .ForeignKeyConstraintDescriptor, .TriggerDescriptorList, .IndexRowGenerator, .KeyConstraintDescriptor, .PasswordHasher, .PermDescriptor, .PermissionsDescriptor, .ReferencedKeyConstraintDescriptor, .RoleClosureIterator, .RoleGrantDescriptor, .RoutinePermsDescriptor, .SPSDescriptor, .SchemaDescriptor, .SequenceDescriptor, .StatisticsDescriptor, .SubCheckConstraintDescriptor, .SubConstraintDescriptor, .SubKeyConstraintDescriptor, .SystemColumn, .TableDescriptor, .TablePermsDescriptor, .TriggerDescriptor, .TupleDescriptor, .UserDescriptor, .ViewDescriptor, org.apache.derby.iapi.sql.execute.ExecIndexRow, .ExecRow, .ExecutionContext, .ExecutionFactory, .ScanQualifier, .TupleFilter, org.apache.derby.iapi.store.access.AccessFactory, .ConglomerateController, .FileResource, .Qualifier, .RowUtil, .ScanController, .TransactionController, org.apache.derby.iapi.types.DataTypeDescriptor, .DataValueDescriptor, .DataValueFactory, .NumberDataValue, .Orderable, .RowLocation, .SQLBoolean, .SQLChar, .SQLLongint, .SQLVarchar, .StringDataValue, .TypeId, .UserType, org.apache.derby.iapi.util.IdUtil, org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl, org.apache.derby.impl.services.locks.Timeout, org.apache.derby.impl.sql.compile.ColumnReference, .QueryTreeNode, .TableName, org.apache.derby.impl.sql.depend.BasicDependencyManager, org.apache.derby.impl.sql.execute.JarUtil

Standard database implementation of the data dictionary that stores the information in the system catalogs.

Field Summary

Modifier and TypeField and Description
pack-priv AccessFactory
private String
protected boolean
private TransactionController
pack-priv ShExLockable
pack-priv volatile int
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private int
collationTypeOfSystemSchemas

Collation Type for SYSTEM schemas.

private int
collationTypeOfUserSchemas

Collation Type for user schemas.

private static final String[]
private static final String[]
private TabInfoImpl[]
public DataDescriptorGenerator
pack-priv volatile int
private SchemaDescriptor
private String[][]
private String[][]
private DD_Version
dictionaryVersion

Dictionary version of the on-disk database

protected DependencyManager
pack-priv static final int
DROP

Possible action for visitPermsByGrantee and visitRoleGrants.

private DataValueFactory
pack-priv int
private ExecutionFactory
pack-priv static final 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
private String
public LockFactory
pack-priv CacheManager
private TabInfoImpl[]
private static final String[]
private static final int
private static final int
pack-priv CacheManager
pack-priv CacheManager
pack-priv int
pack-priv volatile int
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
private CacheManager
private HashMap<String, HashMap<String, String>>
private DD_Version
softwareVersion

Dictionary version of the currently running engine

private Hashtable<UUID, SPSDescriptor>
private CacheManager
private String
pack-priv Properties
pack-priv int
private static final int
private static final int
private static final int
SYSFUN_DETERMINISTIC_INDEX

Index into SYSFUN_FUNCTIONS of the DETERMINISTIC indicator.

private static final int
SYSFUN_FIRST_PARAMETER_INDEX

The index of the first parameter in entries in the SYSFUN_FUNCTIONS table.

private static final String[][]
SYSFUN_FUNCTIONS

SYSFUN functions.

private static final int
SYSFUN_VARARGS_INDEX

Index into SYSFUN_FUNCTIONS of the VARARGS indicator.

private final AliasDescriptor[]
sysfunDescriptors

Runtime definition of the functions from SYSFUN_FUNCTIONS.

private SchemaDescriptor
private static final int
private static final int
private SchemaDescriptor
private static final String[]
systemSchemaNames

List of all "system" schemas

This list should contain all schema's used by the system and are created when the database is created.

private int
private SchemaDescriptor
private static final String[]
sysUtilFunctionsWithPublicAccess

List of functions in SYSCS_UTIL schema with PUBLIC access

private static final String[]
sysUtilProceduresWithPublicAccess

List of procedures in SYSCS_UTIL schema with PUBLIC access

pack-priv int
private boolean
protected UUIDFactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

The corresponding Active ConstraintDescriptorList
activeConstraint
(ConstraintDescriptor
the constraint to check
constraint
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.activeConstraint.

Reports whether an individual constraint must be enforced.

public void
addConstraintDescriptor(ConstraintDescriptor
The descriptor to add
descriptor
,
TransactionController
The transaction controller
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.addConstraintDescriptor.

Adds the given ConstraintDescriptor to the data dictionary, associated with the given table and constraint type.

public void
addDescriptor(TupleDescriptor
descriptor to insert.
td
,
TupleDescriptor
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.
parent
,
int
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.
catalogNumber
,
boolean
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.
duplicatesAllowed
,
TransactionController
the transaction controller to use to do all of this.
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.addDescriptor.

Adds a descriptor to a system catalog identified by the catalogNumber.

public void
addDescriptorArray(TupleDescriptor[] td, TupleDescriptor parent, int catalogNumber, boolean allowDuplicates, TransactionController tc)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.addDescriptorArray.

array version of addDescriptor.

public boolean

Returns:

True means revoke has removed a privilege from system table and hence the caller of this method should send invalidation actions to PermssionDescriptor's dependents.
addRemovePermissionsDescriptor
(boolean
if true then the permission is added, if false the permission is removed
add
,
PermissionsDescriptor perm, String grantee, TransactionController tc)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.addRemovePermissionsDescriptor.

Add or remove a permission to/from the permission database.

public void
addSPSDescriptor(SPSDescriptor
The descriptor to add
descriptor
,
TransactionController
The transaction controller
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.addSPSDescriptor.

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
The KeyConstraintDescriptor for the constraint.
descriptor
,
TransactionController
The TransactionController
tc
)

Add the matching row to syskeys when adding a unique or primary key constraint

pack-priv void
addSYSCOLUMNSIndex2Property(TransactionController tc, long index2ConglomerateNumber)

private SchemaDescriptor
addSystemSchema(String
name of the schema to add.
schema_name
,
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.

public void
addTableDescriptorToOtherCache(TableDescriptor
TableDescriptor to add to the other cache.
td
,
Cacheable
Cacheable Object which lets us figure out the other cache.
c
)

Add a table descriptor to the "other" cache.

public void
boot(boolean
True if the database should be created
create
,
Properties
The start-up parameters
startParams
)

Implements org.apache.derby.iapi.services.monitor.ModuleControl.boot.

Start-up method for this instance of the data dictionary.

private static Object
bootServiceModule(final boolean create, final Object serviceModule, final String factoryInterface, final Properties properties)

Must be private so that user code can't call this entry point.

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.

public boolean

Returns:

true if this service requested is for a database engine.
canSupport
(Properties startParams)

Implements org.apache.derby.iapi.services.monitor.ModuleSupportable.canSupport.

This is the data dictionary implementation for the standard database engine.

private void
checkInvalidTriggerReference(String tableName, String oldReferencingName, String newReferencingName, int triggerEventMask)

public boolean

Returns:

True if the database has been upgraded to the required level, false otherwise.
checkVersion
(int
Data Dictionary major version
requiredMajorVersion
,
String
Non-null to throw an error, null to return the state of the version match.
feature
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.checkVersion.

Check to see if a database has been upgraded to the required level in order to use a language feature.

public void
clearCaches()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.clearCaches.

Clear all of the DataDictionary caches.

public void
clearCaches(boolean clearSequenceCaches)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.clearCaches.

Clear the DataDictionary caches, including the sequence caches if requested..

private void
clearNoncoreTable(int nonCoreNum)

public void
clearSequenceCaches()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.clearSequenceCaches.

Flush sequence caches to disk so that we don't leak unused, pre-allocated numbers.

pack-priv void
clearSPSPlans()

Mark all SPS plans in the data dictionary invalid.

public RowLocation[]
computeAutoincRowLocations(TransactionController
TransactionControler to use to compute the row location.
tc
,
TableDescriptor
TableDescriptor
td
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.computeAutoincRowLocations.

returns an array of RowLocations corresponding to the autoincrement columns in the table.

private RowLocation
computeRowLocation(TransactionController
Transaction Controller to use.
tc
,
TableDescriptor
Table Descriptor.
td
,
String
Name of column which has autoincrement column.
columnName
)

Computes the RowLocation in SYSCOLUMNS for a particular autoincrement column.

public void
computeSequenceRowLocation(TransactionController
Transaction Controller to use.
tc
,
String
UUID of the sequence as a string
sequenceIDstring
,
RowLocation[]
OUTPUT param for returing the row location
rowLocation
,
SequenceDescriptor[]
OUTPUT param for return the sequence descriptor
sequenceDescriptor
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.computeSequenceRowLocation.

Computes the RowLocation in SYSSEQUENCES for a particular sequence.

pack-priv void
create_10_10_system_procedures(TransactionController
an instance of the Transaction Controller.
tc
,
HashSet<String>
set of routines we are creating (used to add permissions later on)
newlyCreatedRoutines
)

Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.10.

pack-priv void
create_10_11_system_procedures(TransactionController
an instance of the Transaction Controller.
tc
,
HashSet<String>
set of routines we are creating (used to add permissions later on)
newlyCreatedRoutines
)

Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.11.

pack-priv void
create_10_12_system_procedures(TransactionController
an instance of the Transaction Controller.
tc
,
HashSet<String>
set of routines we are creating (used to add permissions later on)
newlyCreatedRoutines
)

Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.12.

pack-priv void
create_10_13_system_procedures(TransactionController
an instance of the Transaction Controller.
tc
,
HashSet<String>
set of routines we are creating (used to add permissions later on)
newlyCreatedRoutines
)

Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.13.

pack-priv void
create_10_1_system_procedures(TransactionController
booting transaction
tc
,
HashSet<String>
set of routines we are creating (used to add permissions later on)
newlyCreatedRoutines
,
UUID
uuid of the SYSUTIL schema.
sysUtilUUID
)

Create system procedures added in version 10.1.

pack-priv void
create_10_2_system_procedures(TransactionController
booting transaction
tc
,
HashSet<String>
set of routines we are creating (used to add permissions later on)
newlyCreatedRoutines
,
UUID
uuid of the SYSUTIL schema.
sysUtilUUID
)

Create system procedures added in version 10.2.

pack-priv void
create_10_3_system_procedures(TransactionController
an instance of the TransactionController.
tc
,
HashSet<String>
set of routines we are creating (used to add permissions later on)
newlyCreatedRoutines
)

Create the System procedures that are added in 10.3.

pack-priv void
create_10_3_system_procedures_SYSCS_UTIL(TransactionController
an instance of the Transaction Controller.
tc
,
HashSet<String>
set of routines we are creating (used to add permissions later on)
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
an instance of the TransactionController class.
tc
,
HashSet<String>
set of routines we are creating (used to add permissions later on)
newlyCreatedRoutines
)

Create system procedures added in version 10.3.

pack-priv void
create_10_5_system_procedures(TransactionController
an instance of the TransactionController.
tc
,
HashSet<String>
set of routines we are creating (used to add permissions later on)
newlyCreatedRoutines
)

Create the System procedures that are added to 10.5.

pack-priv void
create_10_6_system_procedures(TransactionController
an instance of the TransactionController.
tc
,
HashSet<String> newlyCreatedRoutines)

Create the System procedures that are added to 10.6.

pack-priv void
create_10_9_system_procedures(TransactionController
an instance of the Transaction Controller.
tc
,
HashSet<String>
set of routines we are creating (used to add permissions later on)
newlyCreatedRoutines
)

Create system procedures that are part of the SYSCS_UTIL schema added in version 10.9.

private final void
create_SYSCS_procedures(TransactionController
transaction controller to use. Counts on caller to commit.
tc
,
HashSet<String>
evolving set of routines which may need to be given permissions later on
newlyCreatedRoutines
)

Create system procedures

Used to add the system procedures to the database when it is created.

protected final void
create_SYSIBM_procedures(TransactionController
transaction controller to use. Counts on caller to commit.
tc
,
HashSet<String>
evolving set of routines which we're adding (some may need permissions later on)
newlyCreatedRoutines
)

Create system procedures in SYSIBM

Used to add the system procedures to the database when it is created.

private long

Returns:

Conglomerate id.
createConglomerate
(String
Name of new catalog.
name
,
TransactionController
Transaction context.
tc
,
ExecRow
Template for rows for the new table
rowTemplate
,
Properties
Properties for createConglomerate
properties
)

Create a conglomerate for a system table

protected void
createDictionaryTables(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.

pack-priv void
createIdentitySequences(TransactionController tc)

Create sequence generators for all identity columns on upgrade to 10.11.

public void
createIndexStatsRefresher(Database
the database object associated with this data dictionary
db
,
String
the name of the database
dbName
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.createIndexStatsRefresher.

Creates an index statistics refresher for this data dictionary.

public RoleClosureIterator
createRoleClosureIterator(TransactionController
transaction controller
tc
,
String
name of starting point for closure
role
,
boolean
If true, compute closure on inverse of relation GRANT role-a TO role-b that is, we look at closure of all roles granted to role. If false, we look at closure of all roles that have been granted role.
inverse
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.createRoleClosureIterator.

This method creates a new iterator over the closure of role grants starting or ending with a given role.

pack-priv void
createRoutinePermPublicDescriptor(UUID
uuid of the routine
routineUUID
,
TransactionController
TransactionController to use
tc
,
String
authorization ID of the permission grantor
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 final UUID

Returns:

UUID UUID of system routine that got created.
createSystemProcedureOrFunction
(String
name of the routine in java and the SQL procedure name.
routine_name
,
UUID schema_uuid, String[]
String array of procedure argument names in order.
arg_names
,
TypeDescriptor[]
Internal SQL types of the arguments
arg_types
,
int num_out_param, int num_result_sets, short
One of the RoutineAliasInfo constants: MODIFIES_SQL_DATA READS_SQL_DATA CONTAINS_SQL NO_SQL
routine_sql_control
,
boolean
True if the procedure/function is DETERMINISTIC
isDeterministic
,
boolean hasVarargs, TypeDescriptor
null for procedure. For functions the return type of the function.
return_type
,
HashSet<String>
evolving set of routines, some of which may need permissions later on
newlyCreatedRoutines
,
TransactionController
an instance of the TransactionController
tc
,
String
the fully qualified name of the class that contains java definitions for the stored procedures
procClass
)

Generic create procedure routine.

private final UUID

Returns:

UUID UUID of system routine that got created.
createSystemProcedureOrFunction
(String
name of the routine in java and the SQL procedure name.
routine_name
,
UUID schema_uuid, String[]
String array of procedure argument names in order.
arg_names
,
TypeDescriptor[]
Internal SQL types of the arguments
arg_types
,
int num_out_param, int num_result_sets, short
One of the RoutineAliasInfo constants: MODIFIES_SQL_DATA READS_SQL_DATA CONTAINS_SQL NO_SQL
routine_sql_control
,
boolean
True if the procedure/function is DETERMINISTIC
isDeterministic
,
boolean hasVarargs, TypeDescriptor
null for procedure. For functions the return type of the function.
return_type
,
HashSet<String>
evolving set of routines, some of which may need permissions later on
newlyCreatedRoutines
,
TransactionController
an instance of the TransactionController
tc
)

Generic create procedure routine.

pack-priv void
createSystemSps(TransactionController tc)

Create system built-in metadata stored prepared statements.

private void
public void
disableIndexStatsRefresher()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.disableIndexStatsRefresher.

Disables automatic refresh/creation of index statistics at runtime.

public boolean
doCreateIndexStatsRefresher()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.doCreateIndexStatsRefresher.

Tells if an index statistics refresher should be created for this database.

public void
doneReading(int
The mode that was returned by startReading().
mode
,
LanguageConnectionContext
The LanguageConnectionContext to use.
lcc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.doneReading.

Inform this DataDictionary that we have finished reading it.

public void
dropAliasDescriptor(AliasDescriptor
The AliasDescriptor to drop
ad
,
TransactionController
The TransactionController
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropAliasDescriptor.

Drop a AliasDescriptor from the DataDictionary

public void
dropAllColumnDescriptors(UUID
The UUID of the table from which to drop all the column descriptors
tableID
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropAllColumnDescriptors.

Drops all column descriptors from the given table.

public void
dropAllConglomerateDescriptors(TableDescriptor
The TableDescriptor of the table
td
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropAllConglomerateDescriptors.

Drops all conglomerates associated with a table.

public void
dropAllConstraintDescriptors(TableDescriptor
The table from which to drop all constraint descriptors
table
,
TransactionController
The TransactionController
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropAllConstraintDescriptors.

Drops all ConstraintDescriptors from the data dictionary that are associated with the given table,

public void
dropAllPermDescriptors(UUID
The UUID of the object from which to drop all the permission descriptors
objectID
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropAllPermDescriptors.

Drops all permission descriptors for the object whose Id is given.

public void
dropAllPermsByGrantee(String
The authentication identifier
authId
,
TransactionController
Transaction Controller
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropAllPermsByGrantee.

Drop all permission descriptors corresponding to a grant to the named authentication identifier

public void
dropAllRoutinePermDescriptors(UUID
The UUID of the routine from which to drop all the permission descriptors
routineID
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropAllRoutinePermDescriptors.

Drops all routine permission descriptors for the given routine.

public void
dropAllTableAndColPermDescriptors(UUID
The UUID of the table from which to drop all the permission descriptors
tableID
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropAllTableAndColPermDescriptors.

Drops all table and column permission descriptors for the given table.

public void
dropColumnDescriptor(UUID
The UUID of the table to drop the column from
tableID
,
String
The name of the column to drop
columnName
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropColumnDescriptor.

Given a column name and a table ID, drops the column descriptor from the table.

private void
dropColumnDescriptorCore(TransactionController
The TransactionController
tc
,
ExecIndexRow
Start/stop position.
keyRow
)

Delete the appropriate rows from syscolumns when dropping 1 or more columns.

private void
dropColumnPermDescriptor(TransactionController
The TransactionController
tc
,
ExecIndexRow
Start/stop position.
keyRow
)

Delete the appropriate rows from syscolperms when dropping a table

public void
dropConglomerateDescriptor(ConglomerateDescriptor
The ConglomerateDescriptor for the conglomerate
conglomerate
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropConglomerateDescriptor.

Drops a conglomerate descriptor

public void
dropConstraintDescriptor(ConstraintDescriptor
The descriptor to drop
descriptor
,
TransactionController
The TransactionController
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropConstraintDescriptor.

Drops the given ConstraintDescriptor from the data dictionary.

public void
dropDependentsStoredDependencies(UUID
Dependent's uuid
dependentsUUID
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropDependentsStoredDependencies.

Remove all of the stored dependencies for a given dependent's ID from the data dictionary.

public void
dropDependentsStoredDependencies(UUID
Dependent's uuid
dependentsUUID
,
TransactionController
TransactionController for the transaction
tc
,
boolean
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.
wait
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropDependentsStoredDependencies.

Remove all of the stored dependencies for a given dependent's ID from the data dictionary.

public void
private void
dropJDBCMetadataSPSes(TransactionController
the xact
tc
)

Remove metadata stored prepared statements.

private void
dropPermsByGrantee(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.

public void
dropRoleGrant(String
The name of the role to drop
roleName
,
String
The grantee
grantee
,
String
The grantor
grantor
,
TransactionController
Transaction Controller
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropRoleGrant.

Drop a role grant

public void
dropRoleGrantsByGrantee(String
The grantee
grantee
,
TransactionController
Transaction Controller
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropRoleGrantsByGrantee.

Drop all role grants corresponding to a grant of (any) role to a named authentication identifier

public void
dropRoleGrantsByName(String
The role name granted
roleName
,
TransactionController
Transaction Controller
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropRoleGrantsByName.

Drop all role grants corresponding to a grant of the named role to any authentication identifier

public void
dropSchemaDescriptor(String
The name of the schema to drop
schemaName
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropSchemaDescriptor.

Drop the descriptor for a schema, given the schema's name

public void
dropSequenceDescriptor(SequenceDescriptor
The descriptor to drop
descriptor
,
TransactionController
The TransactionController.
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropSequenceDescriptor.

Drops a sequence descriptor

private void
dropSequenceID(SequenceDescriptor sd)

Drop a sequenceID from the ( schemaName, sequenceName ) map

public void
dropSPSDescriptor(SPSDescriptor
The descriptor to drop
descriptor
,
TransactionController
The TransactionController.
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropSPSDescriptor.

Drops the given SPSDescriptor.

public void
dropSPSDescriptor(UUID
the statement uuid
uuid
,
TransactionController
The TransactionController.
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropSPSDescriptor.

Drops the given SPSDescriptor.

public void
dropStatisticsDescriptors(UUID
UUID of the table
tableUUID
,
UUID
UUID of the index. This can be null.
referenceUUID
,
TransactionController
Transcation Controller to use.
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropStatisticsDescriptors.

Drops all statistics descriptors for a given table/index column combination.

public void
dropStoredDependency(DependencyDescriptor
The DependencyDescriptor.
dd
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropStoredDependency.

Drop a single dependency from the data dictionary.

private void
dropSubCheckConstraint(UUID
The constraint id.
constraintId
,
TransactionController
The TransactionController
tc
)

Drop the matching row from syschecks when dropping a check constraint.

private void
dropSubKeyConstraint(ConstraintDescriptor
the constraint
constraint
,
TransactionController
The TransactionController
tc
)

Drop the matching row from syskeys when dropping a primary key or unique constraint.

public void
dropTableDescriptor(TableDescriptor
The table descriptor to drop
td
,
SchemaDescriptor
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) schema
schema
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropTableDescriptor.

Drop the table descriptor.

private void
dropTablePermDescriptor(TransactionController
The TransactionController
tc
,
ExecIndexRow
Start/stop position.
keyRow
)

Delete the appropriate rows from systableperms when dropping a table

public void
dropTriggerDescriptor(TriggerDescriptor
The descriptor to drop
descriptor
,
TransactionController
The TransactionController.
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropTriggerDescriptor.

Drops the given TriggerDescriptor.

public void
dropUser(String
The user to drop.
userName
,
TransactionController
The TransactionController
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropUser.

Drop a User from the DataDictionary

public void
dropViewDescriptor(ViewDescriptor
A descriptor for the view to be dropped
vd
,
TransactionController
TransactionController to use
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.dropViewDescriptor.

Drops the view descriptor from the data dictionary.

private StandardException
public int[]

Returns:

Transformed trigger action sql
examineTriggerNodeAndCols
(Visitable
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.
actionStmt
,
String
The name specified by the user for REFERENCEs to old row columns
oldReferencingName
,
String
The name specified by the user for REFERENCEs to new row columns
newReferencingName
,
String
The original trigger action text provided by the user during CREATE TRIGGER time.
triggerDefinition
,
int[]
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))
referencedCols
,
int[]
what columns does the trigger action reference through old/new transition variables (may be null)
referencedColsInTriggerAction
,
int
offset of start of action clause
actionOffset
,
TableDescriptor
Table descriptor for trigger table
triggerTableDescriptor
,
int
TriggerDescriptor.TRIGGER_EVENT_XXX
triggerEventMask
,
boolean
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.
createTriggerTime
,
List<int[]> replacements)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.examineTriggerNodeAndCols.

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().

public boolean

Returns:

boolean true if such a grant exists
existsGrantToAuthid
(String
grantee for which a grant exists or not
authId
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.existsGrantToAuthid.

Check all dictionary tables and return true if there is any GRANT descriptor containing authId as its grantee.

private boolean
existsPermByGrantee(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

Returns:

true if there exists such a grant
existsRoleGrantByGrantee
(String
authorization identifier
grantee
,
TransactionController
Transaction Controller
tc
)

Return true if there exists a role grant to authorization identifier.

public boolean

Returns:

true iff there is a matching schema
existsSchemaOwnedBy
(String
authorizationId
authid
,
TransactionController
TransactionController
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.existsSchemaOwnedBy.

Return true of there exists a schema whose authorizationId equals authid, i.e. SYS.SYSSCHEMAS contains a row whose column (AUTHORIZATIONID) equals authid.

private void
faultInTabInfo(TabInfoImpl
TabInfoImpl to fault in.
ti
)

Finishes building a TabInfoImpl if it hasn't already been faulted in. NOP if TabInfoImpl has already been faulted in.

private String

Returns:

the name of the algorithm to use as the default
findDefaultBuiltinAlgorithm
()

Find the default message digest algorithm to use for BUILTIN authentication on this database.

private static Object
findServiceModule(final Object serviceModule, final String factoryInterface)

Must be private so that user code can't call this entry point.

private TableDescriptor

Returns:

The completed TableDescriptor.
finishTableDescriptor
(TableDescriptor
The TableDescriptor.
td
)

Finish filling in the TableDescriptor.

public void
flushBulkInsertCounter(String
UUID of the sequence which backs the identity column.
sequenceUUIDString
,
BulkInsertCounter
the BulkInsertCounter which generates identities for bulk insert
bic
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.flushBulkInsertCounter.

Flush the updated values of the BulkInsertCounter to disk and to the original, cached SequenceUpdater.

private String
genColumnReferenceSQL(TableDescriptor td, String colName, String tabName, boolean isOldTable, int colPositionInRuntimeResultSet)

private byte[]

Returns:

random bytes
generateRandomSalt
(Dictionary<K, V>
database properties that possibly specify the desired length of the salt
props
)

Generate an array of random bytes to use as salt when hashing credentials.

public ConstraintDescriptorList

Returns:

The corresponding Active ConstraintDescriptorList
getActiveConstraintDescriptors
(ConstraintDescriptorList
The constraint descriptor list to wrap with an Active constraint descriptor list.
cdl
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getActiveConstraintDescriptors.

Convert a constraint descriptor list into a list of active constraints, that is, constraints which must be enforced.

public AliasDescriptor

Returns:

The AliasDescriptor for the alias.
getAliasDescriptor
(UUID
The UUID
uuid
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getAliasDescriptor.

Get a AliasDescriptor given its UUID.

public AliasDescriptor

Returns:

AliasDescriptor AliasDescriptor for the alias name and name space
getAliasDescriptor
(String
schema identifier
schemaId
,
String
The alias name.
aliasName
,
char
The alias type.
nameSpace
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getAliasDescriptor.

Get a AliasDescriptor by alias name and name space.

public AliasDescriptor

Returns:

The UDT's alias descriptor if it is an ANSI UDT; null otherwise.
getAliasDescriptorForUDT
(TransactionController
The transaction to use: if null, use the compilation transaction
tc
,
DataTypeDescriptor
The UDT's type descriptor
dtd
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getAliasDescriptorForUDT.

Get the alias descriptor for an ANSI UDT.

private ConstraintDescriptorList

Returns:

the list of descriptors
getAllConstraintDescriptors
()

Get every constraint in this database.

public List<TupleDescriptor>

Returns:

List List of all DependencyDescriptors.
getAllDependencyDescriptorsList
()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getAllDependencyDescriptorsList.

Build and return an List with DependencyDescriptors for all of the stored dependencies.

public List<SPSDescriptor>

Returns:

the list of descriptors
getAllSPSDescriptors
()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getAllSPSDescriptors.

Get every statement in this database.

public String

Returns:

authorizationID
getAuthorizationDatabaseOwner
()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getAuthorizationDatabaseOwner.

Get authorizationID of Database Owner

private long
getBootParameter(Properties startParams, String key, boolean required)

private void
getBuiltinSystemSchemas()

Set up the builtin schema descriptors for system schemas.

public String
getBuiltinVTIClass(TableDescriptor
Table descriptor used for the VTI look-up.
td
,
boolean
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".
asTableFunction
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getBuiltinVTIClass.

Return the Java class to use for a builtin VTI to which the received table descriptor maps.

public BulkInsertCounter
getBulkInsertCounter(String
UUID of the sequence which backs the identity column.
sequenceUUIDString
,
boolean
True if the counter should be re-initialized to its start position.
restart
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getBulkInsertCounter.

Get the identity generator used to support the bulk-insert optimization in InsertResultSet.

public int
getCacheMode()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getCacheMode.

Returns the cache mode of the data dictionary.

public int
public int
public DependableFinder
getColumnDependableFinder(int
the format id
formatId
,
byte[]
byte array encoding the bitmap of referenced columns
columnBitMap
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getColumnDependableFinder.

Get a DependableFinder instance for referenced columns in a table.

public ColumnDescriptor

Returns:

The ColumnDescriptor for the column.
getColumnDescriptorByDefaultId
(UUID
The UUID of the default
uuid
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getColumnDescriptorByDefaultId.

Get a ColumnDescriptor given its Default ID.

private void
getColumnDescriptorsScan(TableDescriptor
The TableDescriptor.
td
)

Populate the ColumnDescriptorList for the specified TableDescriptor.

private void
getColumnDescriptorsScan(UUID
The referencing UUID
uuid
,
ColumnDescriptorList
The column descriptor list
cdl
,
TupleDescriptor
The parent tuple descriptor
td
)

Populate the ColumnDescriptorList for the specified TableDescriptor.

public ColPermsDescriptor
getColumnPermissions(UUID colPermsUUID)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getColumnPermissions.

Get one user's column privileges on a table using colPermsUUID

public ColPermsDescriptor

Returns:

a ColPermsDescriptor or null if the user has no separate column permissions of the specified type on the table. Note that the user may have been granted permission on all the columns of the table (no column list), in which case this routine will return null. You must also call getTablePermissions to see if the user has permission on a set of columns.
getColumnPermissions
(UUID tableUUID, int
(as int) Authorizer.SELECT_PRIV, Authorizer.UPDATE_PRIV, or Authorizer.REFERENCES_PRIV
privType
,
boolean forGrant, String
The user name
authorizationId
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getColumnPermissions.

Get one user's column privileges for a table.

public ColPermsDescriptor

Returns:

a ColPermsDescriptor or null if the user has no separate column permissions of the specified type on the table. Note that the user may have been granted permission on all the columns of the table (no column list), in which case this routine will return null. You must also call getTablePermissions to see if the user has permission on a set of columns.
getColumnPermissions
(UUID tableUUID, String
(as String) Authorizer.SELECT_PRIV, Authorizer.UPDATE_PRIV, or Authorizer.REFERENCES_PRIV
privTypeStr
,
boolean forGrant, String
The user name
authorizationId
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getColumnPermissions.

Get one user's column privileges for a table.

public ConglomerateDescriptor

Returns:

A ConglomerateDescriptor for the conglomerate.
getConglomerateDescriptor
(UUID
The UUID
uuid
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConglomerateDescriptor.

Get a ConglomerateDescriptor given its UUID.

public ConglomerateDescriptor

Returns:

A ConglomerateDescriptor for the conglomerate. Returns NULL if no such conglomerate.
getConglomerateDescriptor
(long
The conglomerate number.
conglomerateNumber
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConglomerateDescriptor.

Get a ConglomerateDescriptor given its conglomerate number.

public ConglomerateDescriptor

Returns:

A ConglomerateDescriptor describing the requested conglomerate. Returns NULL if no such conglomerate.
getConglomerateDescriptor
(String
The name of the index we're looking for
indexName
,
SchemaDescriptor
The schema descriptor
sd
,
boolean
Whether or not to get an exclusive row lock on the row in sys.sysconglomerates.
forUpdate
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConglomerateDescriptor.

Gets a conglomerate descriptor for the named index in the given schema, getting an exclusive row lock on the matching row in sys.sysconglomerates (for DDL concurrency) if requested.

public ConglomerateDescriptor[]

Returns:

An array of ConglomerateDescriptors for the conglomerate. returns size 0 array if no such conglomerate.
getConglomerateDescriptors
(UUID
The UUID
uuid
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConglomerateDescriptors.

Get an array of ConglomerateDescriptors given the UUID.

public ConglomerateDescriptor[]

Returns:

An array of ConglomerateDescriptors that share the requested conglomerate. Returns size 0 array if no such conglomerate.
getConglomerateDescriptors
(long
The number for the conglomerate we're interested in
conglomerateNumber
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConglomerateDescriptors.

Get an array of conglomerate descriptors for the given conglomerate number.

private void
getConglomerateDescriptorsScan(TableDescriptor
The TableDescriptor.
td
)

Populate the ConglomerateDescriptorList for the specified TableDescriptor by scanning sysconglomerates.

public ConstraintDescriptor

Returns:

The ConstraintDescriptor for the constraint.
getConstraintDescriptor
(UUID
The UUID
uuid
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConstraintDescriptor.

Get a ConstraintDescriptor given its UUID.

public ConstraintDescriptor

Returns:

The ConstraintDescriptor for the constraint.
getConstraintDescriptor
(String
Constraint name.
constraintName
,
UUID
The schema UUID
schemaID
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConstraintDescriptor.

Get a ConstraintDescriptor given its name and schema ID. Please use getConstraintDescriptorByName() if you have the constraint's table descriptor, it is much faster.

public ConstraintDescriptor

Returns:

The ConstraintDescriptor for the constraint.
getConstraintDescriptor
(TableDescriptor
The table descriptor.
td
,
UUID
the UUID for the backing index.
uuid
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConstraintDescriptor.

Get the constraint descriptor given a table and the UUID String of the backing index.

public ConstraintDescriptor

Returns:

The ConstraintDescriptor for the constraint.
getConstraintDescriptorById
(TableDescriptor
The table descriptor.
td
,
UUID
The UUID for the constraint
uuid
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConstraintDescriptorById.

Get the constraint descriptor given a table and the UUID String of the constraint

public ConstraintDescriptor

Returns:

The ConstraintDescriptor for the constraint.
getConstraintDescriptorByName
(TableDescriptor
The table descriptor.
td
,
SchemaDescriptor
The schema descriptor for the constraint
sd
,
String
The constraint name.
constraintName
,
boolean
Whether or not access is for update
forUpdate
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConstraintDescriptorByName.

Get the constraint descriptor given a TableDescriptor and the constraint name.

public ConstraintDescriptorList

Returns:

The ConstraintDescriptorList for the table
getConstraintDescriptors
(TableDescriptor
The table descriptor. If null, all constraint descriptors are returned.
td
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConstraintDescriptors.

Load up the constraint descriptor list for this table descriptor and return it.

private void
getConstraintDescriptorsScan(TableDescriptor
The TableDescriptor.
td
,
boolean
Whether or not to open scan for update
forUpdate
)

Populate the ConstraintDescriptorList for the specified TableDescriptor.

protected TupleDescriptor

Returns:

The last matching descriptor
getConstraintDescriptorViaHeap
(ScanQualifier[][]
qualifiers
scanQualifiers
,
TabInfoImpl
The TabInfoImpl to use
ti
,
TupleDescriptor
The parentDescriptor, if applicable.
parentTupleDescriptor
,
ConstraintDescriptorList
The list to build, if supplied. If null, then caller expects a single descriptor
list
)

Return a (single or list of) catalog row descriptor(s) from SYSCONSTRAINTS through a heap scan

protected ConstraintDescriptor

Returns:

The last matching descriptor
getConstraintDescriptorViaIndex
(int
The id of the index (0 to # of indexes on table) to use
indexId
,
ExecIndexRow
The supplied ExecIndexRow for search
keyRow
,
TabInfoImpl
The TabInfoImpl to use
ti
,
TableDescriptor
The TableDescriptor, if supplied.
td
,
ConstraintDescriptorList
The list to build, if supplied. If null, then caller expects a single descriptor
dList
,
boolean
Whether or not to open scan for update
forUpdate
)

Return a (single or list of) ConstraintDescriptor(s) from SYSCONSTRAINTS where the access is from the index to the heap.

public List<UUID>

Returns:

a list of UUIDs in an List.
getConstraints
(UUID
The id of the constraint
uuid
,
int
The index id in SYS.SYSCONSTRAINTS
indexId
,
int
The column to retrieve
columnNum
)

Return an List which of the relevant column matching the indexed criteria.

public TableDescriptor

Returns:

the corresponding table descriptor
getConstraintTableDescriptor
(UUID
The id of the constraint
constraintId
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getConstraintTableDescriptor.

Return a table descriptor corresponding to the TABLEID field in SYSCONSTRAINTS where CONSTRAINTID matches the constraintId passsed in.

private static Context
getContext(final String contextID)

Must be private so that user code can't call this entry point.

private static Context
getContextOrNull(final String contextID)

Must be private so that user code can't call this entry point.

private static ContextService
getContextService()

Must be private so that user code can't call this entry point.

public void
getCurrentValueAndAdvance(String
String value of the UUID which identifies the sequence
sequenceUUIDstring
,
NumberDataValue
This is a data value to be stuffed with the next sequence number.
returnValue
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getCurrentValueAndAdvance.

Get the next number from an ANSI/ISO sequence generator which was created with the CREATE SEQUENCE statement.

public DataDescriptorGenerator

Returns:

A DataDescriptorGenerator
getDataDescriptorGenerator
()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getDataDescriptorGenerator.

Get a DataDescriptorGenerator, through which we can create objects to be stored in the DataDictionary.

public DataValueFactory

Returns:

A DataValueFactory
getDataValueFactory
()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getDataValueFactory.

Get a DataValueFactory, through which we can create data value objects.

public SchemaDescriptor

Returns:

The descriptor for the schema.
getDeclaredGlobalTemporaryTablesSchemaDescriptor
()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getDeclaredGlobalTemporaryTablesSchemaDescriptor.

Get the descriptor for the declared global temporary table schema which is always named "SESSION".

public DependableFinder
getDependableFinder(int
the format id
formatId
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getDependableFinder.

Get a DependableFinder instance.

public DependencyManager
getDependencyManager()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getDependencyManager.

returns the dependencymanager associated with this datadictionary.

public List<DependencyDescriptor>

Returns:

List Returns a list of DependencyDescriptors. Returns an empty List if no stored dependencies for the dependent's ID.
getDependentsDescriptorList
(String
The ID of the dependent we're interested in
dependentID
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getDependentsDescriptorList.

Gets a list of the dependency descriptors for the given dependent's id.

protected <T extends TupleDescriptor> T

Returns:

The last matching descriptor
getDescriptorViaHeap
(FormatableBitSet
which columns to fetch from the system table, or null to fetch all columns
columns
,
ScanQualifier[][]
qualifiers
scanQualifiers
,
TabInfoImpl
The TabInfoImpl to use
ti
,
TupleDescriptor
The parentDescriptor, if applicable.
parentTupleDescriptor
,
List<? super T>
The list to build, if supplied. If null, then caller expects a single descriptor
list
,
Class<T>
The type of descriptor to look for
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> T

Returns:

The last matching descriptor
getDescriptorViaIndex
(int
The id of the index (0 to # of indexes on table) to use
indexId
,
ExecIndexRow
The supplied ExecIndexRow for search
keyRow
,
ScanQualifier[][] scanQualifiers, TabInfoImpl
The TabInfoImpl to use
ti
,
TupleDescriptor
The parentDescriptor, if applicable.
parentTupleDescriptor
,
List<? super T>
The list to build, if supplied. If null, then caller expects a single descriptor
list
,
Class<T>
The type of descriptor to return
returnType
,
boolean
Whether or not to open the index for update.
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> T

Returns:

The last matching descriptor. If isolationLevel is ISOLATION_READ_UNCOMMITTED, the base row may be gone by the time we access it via the index; in such a case a null is returned.
getDescriptorViaIndex
(int
The id of the index (0 to # of indexes on table) to use
indexId
,
ExecIndexRow
The supplied ExecIndexRow for search
keyRow
,
ScanQualifier[][] scanQualifiers, TabInfoImpl
The TabInfoImpl to use
ti
,
TupleDescriptor
The parentDescriptor, if applicable.
parentTupleDescriptor
,
List<? super T>
The list to build, if supplied. If null, then caller expects a single descriptor
list
,
Class<T>
The type of descriptor to return
returnType
,
boolean
Whether or not to open the index for update.
forUpdate
,
int
Use this explicit isolation level. Only ISOLATION_REPEATABLE_READ (normal usage) or ISOLATION_READ_UNCOMMITTED (corner cases) supported for now.
isolationLevel
,
TransactionController
Transaction controller
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> T
getDescriptorViaIndexMinion(int indexId, ExecIndexRow keyRow, ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, List<? super T> list, Class<T> returnType, boolean forUpdate, int isolationLevel, TransactionController tc)

public int
public ExecutionFactory

Returns:

The ExecutionFactory
getExecutionFactory
()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getExecutionFactory.

Get ExecutionFactory associated with this database.

public FileInfoDescriptor
getFileInfoDescriptor(UUID
The descriptor's id.
id
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getFileInfoDescriptor.

Get a FileInfoDescriptor given its id.

public FileInfoDescriptor
getFileInfoDescriptor(SchemaDescriptor
the schema that holds the FileInfoDescriptor.
sd
,
String
SQL name of file.
name
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getFileInfoDescriptor.

Get a FileInfoDescriptor given its SQL name and schema name.

private FileInfoDescriptor

Returns:

The matching descriptor or null.
getFileInfoDescriptorIndex1Scan
(UUID schemaId, String name)

Scan sysfiles_index1 (schemaid,name) for a match.

private FileInfoDescriptor

Returns:

TableDescriptor The matching descriptor, or null.
getFileInfoDescriptorIndex2Scan
(UUID id)

Scan sysfiles_index2 (id) for a match.

public ConstraintDescriptorList

Returns:

list of constraints, empty of there are none
getForeignKeys
(UUID
The id of the referenced constraint
constraintId
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getForeignKeys.

Return a list of foreign keys constraints referencing this constraint.

public PermDescriptor

Returns:

The descriptor of the permissions for the object
getGenericPermissions
(UUID
The id of the protected object
objectUUID
,
String
Type of the object (e.g., SEQUENCE)
objectType
,
String
The kind of privilege needed (e.g., PermDescriptor.USAGE_PRIV)
privilege
,
String
The user or role who wants to have permission on this object
granteeAuthId
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getGenericPermissions.

Get permissions granted to one user for an object using the object's Id and the user's authorization Id.

public PermDescriptor

Returns:

The descriptor of the user's permissions for the object.
getGenericPermissions
(UUID permUUID)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getGenericPermissions.

Get one user's privileges for an object using the permUUID.

private static SQLChar

Returns:

the UUID converted to an DataValueDescriptor
getIDValueAsCHAR
(UUID uuid)

Converts a UUID to an DataValueDescriptor.

public static ExecIndexRow

Returns:

ExecIndexRow Index row.
getIndexRowFromHeapRow
(IndexRowGenerator
IndexRowGenerator to use
irg
,
RowLocation
RowLocation for heap
rl
,
ExecRow
Row from the heap
heapRow
)

Get an index row based on a row from the heap.

public IndexStatisticsDaemon
getIndexStatsRefresher(boolean
whether the usage is automatic (true) or explicit (false)
asDaemon
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getIndexStatsRefresher.

Returns the index statistics refresher.

private int

Returns:

the value of the property
getIntProperty
(Dictionary<K, V>
database properties
props
,
String
the key of the property
key
,
int
which value to return if the property is not set, or if the property value is not in the valid range
defaultValue
,
int
lowest property value to accept
minValue
,
int
highest property value to accept
maxValue
)

Get the value of an integer property.

private static LanguageConnectionContext
pack-priv static ModuleFactory
getMonitor()

Must be package private so that user code can't call this entry point.

private TabInfoImpl
getNonCoreTI(int
The index into noncoreTable[].
catalogNumber
)

Get a TabInfoImpl for a non-core table.

protected TabInfoImpl
getNonCoreTIByNumber(int catalogNumber)

returns the tabinfo for a non core system catalog.

private Object
private CacheManager
public List<DependencyDescriptor>

Returns:

List Returns a list of DependencyDescriptors. Returns an empty List if no stored dependencies for the provider's ID.
getProvidersDescriptorList
(String
The ID of the provider we're interested in
providerID
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getProvidersDescriptorList.

Gets a list of the dependency descriptors for the given provider's id.

private final synchronized Properties
getQueryDescriptions(boolean net)

public RoleGrantDescriptor

Returns:

The descriptor (row) for the role
getRoleDefinitionDescriptor
(String
The name of the role we're interested in.
roleName
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getRoleDefinitionDescriptor.

Get the target role definition by searching for a matching row in SYSROLES by rolename where isDef==true.

public RoleGrantDescriptor
getRoleGrantDescriptor(UUID uuid)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getRoleGrantDescriptor.

Get the role grant descriptor corresponding to the uuid provided

public RoleGrantDescriptor

Returns:

The descriptor for the role grant
getRoleGrantDescriptor
(String
The name of the role we're interested in.
roleName
,
String
The grantee
grantee
,
String
The grantor
grantor
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getRoleGrantDescriptor.

Get the target role by searching for a matching row in SYSROLES by rolename, grantee and grantor.

pack-priv HashMap<String, List<RoleGrantDescriptor>>

Returns:

hash map representing role grant graph.
  • Key: rolename,
  • Value: List representing a grant of that rolename to another role (not user).
FIXME: Need to cache graph and invalidate when role graph is modified. Currently, we always read from SYSROLES.
getRoleGrantGraph
(TransactionController
Transaction Controller
tc
,
boolean
make graph on inverse grant relation
inverse
)

Return an in-memory representation of the role grant graph (sans grant of roles to users, only role-role relation.

public List<AliasDescriptor>
getRoutineList(String schemaID, String routineName, char nameSpace)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getRoutineList.

Get the list of routines matching the schema and routine name.

public RoutinePermsDescriptor

Returns:

The descriptor of the users permissions for the routine.
getRoutinePermissions
(UUID routineUUID, String
The user's name
authorizationId
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getRoutinePermissions.

Get one user's permissions for a routine (function or procedure).

public RoutinePermsDescriptor
getRoutinePermissions(UUID routinePermsUUID)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getRoutinePermissions.

Get one user's privileges for a routine using routinePermsUUID

public RowLocation
public SchemaDescriptor

Returns:

The descriptor for the schema. Can be null (not found) if raiseError is false.
getSchemaDescriptor
(String
The name of the schema we're interested in. Must not be null.
schemaName
,
TransactionController
TransactionController
tc
,
boolean
whether an exception should be thrown if the schema does not exist.
raiseError
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSchemaDescriptor.

Get the descriptor for the named schema.

public SchemaDescriptor

Returns:

The descriptor for the schema, null if no such schema exists.
getSchemaDescriptor
(UUID
The id of the schema we're interested in.
schemaId
,
TransactionController
The transaction controller to us when scanning SYSSCHEMAS
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSchemaDescriptor.

Get the SchemaDescriptor for the given schema identifier.

public SchemaDescriptor
getSchemaDescriptor(UUID
the uuid of the schema we want a descriptor for
schemaId
,
int
use this explicit isolation level. Only ISOLATION_REPEATABLE_READ (normal usage) or ISOLATION_READ_UNCOMMITTED (corner cases) supported for now.
isolationLevel
,
TransactionController
transaction controller
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSchemaDescriptor.

Get the SchemaDescriptor for the given schema identifier.

private SchemaDescriptor
getSchemaDescriptorBody(UUID schemaId, int isolationLevel, TransactionController tc)

public SequenceDescriptor
getSequenceDescriptor(UUID
uuid of the sequence
uuid
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSequenceDescriptor.

get a descriptor for a Sequence by uuid

public SequenceDescriptor

Returns:

The SequenceDescriptor for the constraints.
getSequenceDescriptor
(SchemaDescriptor
The schema descriptor.
sd
,
String
The sequence name, guaranteed to be unique only within its schema.
sequenceName
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSequenceDescriptor.

Get the sequence descriptor given a sequence name and a schema Id.

private String
getSequenceID(String schemaName, String sequenceName)

Get the uuid string of a sequence given its schema and sequence name.

public NumberDataValue
getSetAutoincrementValue(RowLocation
RowLocation of the entry in SYSCOLUMNS.
rl
,
TransactionController
TransactionController to use.
tc
,
boolean
Write the new value to disk if TRUE.
doUpdate
,
NumberDataValue
A NumberDataValue to use to return incremented value. If null, then the caller simply wants the current value fromd disk.
newValue
,
boolean
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.
wait
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSetAutoincrementValue.

getSetAutoincrementValue fetches the autoincrement value from SYSCOLUMNS given a row location.

public SPSDescriptor

Returns:

The SPSDescriptor for the constraint.
getSPSDescriptor
(UUID
The UUID
uuid
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSPSDescriptor.

Get a SPSDescriptor given its UUID.

public SPSDescriptor

Returns:

The SPSDescriptor for the constraint.
getSPSDescriptor
(String
the statement name
stmtName
,
SchemaDescriptor
The SchemaDescriptor
sd
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSPSDescriptor.

Get a SPSDescriptor given its name.

private SPSDescriptor

Returns:

SPSDescriptor The matching descriptor, if any.
getSPSDescriptorIndex1Scan
(String stmtName, String schemaUUID)

Scan sysschemas_index1 (stmtname, schemaid) for a match.

private SPSDescriptor

Returns:

SPSDescriptor The matching descriptor, if any.
getSPSDescriptorIndex2Scan
(String stmtUUID)

Scan sysstatements_index2 (stmtid) for a match.

public DataTypeDescriptor[]

Returns:

array of data type descriptors
getSPSParams
(SPSDescriptor
sps descriptor
spsd
,
List<DataValueDescriptor>
list for storing column defaults
defaults
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSPSParams.

Get all the parameter descriptors for an SPS.

public List<StatisticsDescriptor>

Returns:

A list of tuple descriptors, possibly empty.
getStatisticsDescriptors
(TableDescriptor
TableDescriptor for which I need statistics
td
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getStatisticsDescriptors.

Returns all the statistics descriptors for the given table.

private SubCheckConstraintDescriptor

Returns:

SubCheckConstraintDescriptor The Sub descriptor for the constraint.
getSubCheckConstraint
(UUID
The UUID for the constraint.
constraintId
)

Get a SubCheckConstraintDescriptor from syschecks for the specified constraint id. (Useful for check constraints.)

public SubKeyConstraintDescriptor

Returns:

SubKeyConstraintDescriptor The Sub descriptor for the constraint.
getSubKeyConstraint
(UUID
The UUID for the constraint.
constraintId
,
int
The type of the constraint (e.g. DataDictionary.FOREIGNKEY_CONSTRAINT)
type
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSubKeyConstraint.

Get a SubKeyConstraintDescriptor from syskeys or sysforeignkeys for the specified constraint id. For primary foreign and and unique key constraints.

public long

Returns:

The heap conglomerate number for SYS.SYSCOLUMNS.
getSYSCOLUMNSHeapConglomerateNumber
()

Get the heap conglomerate number for SYS.SYSCOLUMNS.

public SchemaDescriptor

Returns:

The descriptor for the schema.
getSysIBMSchemaDescriptor
()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSysIBMSchemaDescriptor.

Get the descriptor for the SYSIBM schema.

public SchemaDescriptor

Returns:

The descriptor for the schema.
getSystemSchemaDescriptor
()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSystemSchemaDescriptor.

Get the descriptor for the system schema.

public String

Returns:

system generated unique name
getSystemSQLName
()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getSystemSQLName.

Returns a unique system generated name.

public SchemaDescriptor

Returns:

The descriptor for the schema.
getSystemUtilSchemaDescriptor
()

Get the descriptor for the SYSCS_UTIL system schema.

public TableDescriptor

Returns:

The descriptor for the table, null if table does not exist.
getTableDescriptor
(String
The name of the table to get the descriptor for
tableName
,
SchemaDescriptor
The descriptor for the schema the table lives in. If null, use the system schema.
schema
,
TransactionController
Transaction context.
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getTableDescriptor.

Get the descriptor for the named table within the given schema.

public TableDescriptor

Returns:

The descriptor for the table, null if the table does not exist.
getTableDescriptor
(UUID
The UUID of the table to get the descriptor for
tableID
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getTableDescriptor.

Get the descriptor for the table with the given UUID.

private TableDescriptor

Returns:

TableDescriptor The matching descriptor, if any.
getTableDescriptorIndex1Scan
(String tableName, String schemaUUID)

Scan systables_index1 (tablename, schemaid) for a match.

private TableDescriptor

Returns:

TableDescriptor The matching descriptor, if any.
getTableDescriptorIndex2Scan
(String tableUUID)

Scan systables_index2 (tableid) for a match.

public TablePermsDescriptor

Returns:

a TablePermsDescriptor or null if the user has no permissions on the table.
getTablePermissions
(UUID tableUUID, String
The user name
authorizationId
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getTablePermissions.

Get one user's privileges on a table

public TablePermsDescriptor
getTablePermissions(UUID tablePermsUUID)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getTablePermissions.

Get one user's privileges on a table using tablePermsUUID

public TransactionController

Returns:

TransactionController The TC to use.
getTransactionCompile
()

Get the TransactionController to use, when not passed in as a parameter.

public TransactionController

Returns:

TransactionController The TC to use.
getTransactionExecute
()

Get the TransactionController to use, when not passed in as a parameter.

private static SortedSet<ColumnReference>

Returns:

all references to transition variables
getTransitionVariables
(Visitable
the node in which to look for transition variables
node
,
String
the name of the old transition variable
oldReferencingName
,
String
the name of the new transition variable
newReferencingName
)

Get all columns that reference transition variables in triggers.

public String
getTriggerActionString(Visitable
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.
actionStmt
,
String
The name specified by the user for REFERENCEs to old row columns
oldReferencingName
,
String
The name specified by the user for REFERENCEs to new row columns
newReferencingName
,
String
The original trigger action text provided by the user during CREATE TRIGGER time.
triggerDefinition
,
int[]
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))
referencedCols
,
int[]
what columns does the trigger action reference through old/new transition variables (may be null)
referencedColsInTriggerAction
,
int
offset of start of action clause
actionOffset
,
TableDescriptor
Table descriptor for trigger table
triggerTableDescriptor
,
int
TriggerDescriptor.TRIGGER_EVENT_XXX
triggerEventMask
,
boolean
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.
createTriggerTime
,
List<int[]>
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.
replacements
,
int[] cols)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getTriggerActionString.

This method does the job of transforming the trigger action plan text as shown below.

public TriggerDescriptor

Returns:

The TriggerDescriptor for the constraint.
getTriggerDescriptor
(UUID
The UUID
uuid
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getTriggerDescriptor.

Get a TriggerDescriptor given its UUID.

public TriggerDescriptor

Returns:

The TriggerDescriptor for the constraint.
getTriggerDescriptor
(String
The sps name.
name
,
SchemaDescriptor
The schema descriptor.
sd
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getTriggerDescriptor.

Get the stored prepared statement descriptor given a sps name.

public TriggerDescriptorList

Returns:

The ConstraintDescriptorList for the table
getTriggerDescriptors
(TableDescriptor
The table descriptor.
td
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getTriggerDescriptors.

Load up the trigger descriptor list for this table descriptor and return it.

private void
getTriggerDescriptorsScan(TableDescriptor
The TableDescriptor.
td
,
boolean
Whether or not to open scan for update
forUpdate
)

Populate the TriggerDescriptorList for the specified TableDescriptor.

pack-priv ColPermsDescriptor

Returns:

a ColPermsDescriptor that describes the column permissions granted to the grantee, null if no column permissions have been granted to him on the table.
getUncachedColPermsDescriptor
(ColPermsDescriptor key)

Get a column permissions descriptor from the system tables, without going through the cache.

pack-priv PermDescriptor

Returns:

a PermDescriptor that describes the table permissions granted to the grantee on an objcet , null if no table-level permissions have been granted to him on the table.
getUncachedGenericPermDescriptor
(PermDescriptor key)

Get an object's permission descriptor from the system tables, without going through the cache.

private <T extends PermissionsDescriptor> T
getUncachedPermissionsDescriptor(int catalogNumber, int indexNumber, T key, Class<T> returnType)

pack-priv RoutinePermsDescriptor

Returns:

a RoutinePermsDescriptor that describes the table permissions granted to the grantee, null if no table-level permissions have been granted to him on the table.
getUncachedRoutinePermsDescriptor
(RoutinePermsDescriptor key)

Get a routine permissions descriptor from the system tables, without going through the cache.

pack-priv SPSDescriptor

Returns:

The descriptor for the sps, null if the sps does not exist.
getUncachedSPSDescriptor
(TableKey
The TableKey of the sps
stmtKey
)

This method can get called from the DataDictionary cache.

protected SPSDescriptor

Returns:

The descriptor for the stmt, null if the table does not exist.
getUncachedSPSDescriptor
(UUID
The UUID of the stmt to get the descriptor for
stmtId
)

This method can get called from the DataDictionary cache.

pack-priv TableDescriptor

Returns:

The descriptor for the table, null if the table does not exist.
getUncachedTableDescriptor
(TableKey
The TableKey of the table
tableKey
)

This method can get called from the DataDictionary cache.

protected TableDescriptor

Returns:

The descriptor for the table, null if the table does not exist.
getUncachedTableDescriptor
(UUID
The UUID of the table to get the descriptor for
tableID
)

This method can get called from the DataDictionary cache.

pack-priv TablePermsDescriptor

Returns:

a TablePermsDescriptor that describes the table permissions granted to the grantee, null if no table-level permissions have been granted to him on the table.
getUncachedTablePermsDescriptor
(TablePermsDescriptor key)

Get a table permissions descriptor from the system tables, without going through the cache.

public UserDescriptor
getUser(String
Name of the user whose credentials we want.
userName
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getUser.

Return the credentials descriptor for the named user.

public UUIDFactory

Returns:

UUIDFactory The UUID Factory for this DataDictionary.
getUUIDFactory
()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getUUIDFactory.

Get the UUID Factory.

private UUID

Returns:

UUID The UUID of the core table.
getUUIDForCoreTable
(String
Name of the table
tableName
,
String
UUID of schema
schemaUUID
,
TransactionController
TransactionController to user
tc
)

Get the UUID for the specified system table.

public ViewDescriptor

Returns:

A descriptor for the view
getViewDescriptor
(UUID
The UUID for the view
uuid
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getViewDescriptor.

Gets the viewDescriptor for the view with the given UUID.

public ViewDescriptor

Returns:

A descriptor for the view
getViewDescriptor
(TableDescriptor
The TableDescriptor for the view.
td
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getViewDescriptor.

Gets the viewDescriptor for the view given the TableDescriptor.

private ViewDescriptor

Returns:

ViewDescriptor The ViewDescriptor for the view.
getViewDescriptorScan
(TableDescriptor
The TableDescriptor for the view.
tdi
)

Get the information for the view from sys.sysviews.

public String
getVTIClass(TableDescriptor
Table descriptor used for the VTI look-up.
td
,
boolean
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".
asTableFunction
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.getVTIClass.

Return the Java class to use for the VTI to which the received table descriptor maps.

private void
grantPublicAccessToSystemRoutine(String
Schema ID
schemaID
,
String
Routine Name
routineName
,
char
Indicates whether the routine is a function/procedure.
nameSpace
,
TransactionController
TransactionController to use
tc
,
String
authorization ID of the permission grantor
authorizationID
)

Grant PUBLIC access to a system routine.

public void
grantPublicAccessToSystemRoutines(HashSet<E> newlyCreatedRoutines, TransactionController
TransactionController to use
tc
,
String
authorization ID of the permission grantor
authorizationID
)

Grant PUBLIC access to specific system routines.

public Hashtable<Long, ConglomerateDescriptor>

Returns:

A Hashtable with all of the ConglomerateDescriptors in the database hashed by conglomerate number.
hashAllConglomerateDescriptorsByNumber
(TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.hashAllConglomerateDescriptorsByNumber.

Get all of the ConglomerateDescriptors in the database and hash them by conglomerate number.

public Hashtable<UUID, TableDescriptor>

Returns:

A Hashtable with all of the Table descriptors in the database hashed by TableId
hashAllTableDescriptorsByTableId
(TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.hashAllTableDescriptorsByTableId.

Get all of the TableDescriptors in the database and hash them by TableId This is useful as a performance optimization for the locking VTIs.

public void
initializeCatalogInfo()

Initialize catalog information.

private void
initializeCoreInfo()

Initialized the core info array.

private void
initializeNoncoreInfo()

Initialized the noncore info array.

private void
protected void
public void
invalidateAllSPSPlans()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.invalidateAllSPSPlans.

Invalidate all the stored plans in SYS.SYSSTATEMENTS.

public void
invalidateAllSPSPlans(LanguageConnectionContext lcc)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.invalidateAllSPSPlans.

Invalidate all the stored plans in SYS.SYSSTATEMENTS for the given language connection context.

public boolean
isReadOnlyUpgrade()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.isReadOnlyUpgrade.

Check if the database is read only and requires some form of upgrade that makes the stored prepared statements invalid.

public boolean

Returns:

true/false
isSchemaEmpty
(SchemaDescriptor
descriptor
sd
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.isSchemaEmpty.

Indicate whether there is anything in the particular schema.

protected boolean

Returns:

true if there is a reference to this schema
isSchemaReferenced
(TransactionController
transaction controller
tc
,
TabInfoImpl
table info for the system table
ti
,
int
index id
indexId
,
int
1 based index column
indexCol
,
DataValueDescriptor
the schemaid in a char orderable
schemaIdOrderable
)

Is the schema id referenced by the system table in question?

public boolean

Returns:

true or false
isSystemSchemaName
(String name)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.isSystemSchemaName.

Determine whether a string is the name of the system schema.

private static boolean

Returns:

true if the table name is a transition variable, false otherwise
isTransitionVariable
(TableName
the table name to check
tableName
,
String
the name of the old transition variable
oldReferencingName
,
String
the name of the new transition variable
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
TransactionController
tc
,
Properties startParams)

Initialize system catalogs.

private SchemaDescriptor

Returns:

The row for the schema
locateSchemaRow
(UUID
The id of the schema we're interested in. If non-null, overrides schemaName
schemaId
,
TransactionController
TransactionController. If null, one is gotten off of the language connection context.
tc
)

Get the target schema by searching for a matching row in SYSSCHEMAS by schemaId.

private SchemaDescriptor

Returns:

The row for the schema
locateSchemaRow
(UUID
The id of the schema we're interested in. If non-null, overrides schemaName
schemaId
,
int
Use this explicit isolation level. Only ISOLATION_REPEATABLE_READ (normal usage) or ISOLATION_READ_UNCOMMITTED (corner cases) supported for now.
isolationLevel
,
TransactionController
TransactionController. If null, one is gotten off of the language connection context.
tc
)

Get the target schema by searching for a matching row in SYSSCHEMAS by schemaId.

private SchemaDescriptor

Returns:

The row for the schema
locateSchemaRow
(String
The name of the schema we're interested in. If schemaId is null, used to qual.
schemaName
,
TransactionController
TransactionController. If null, one is gotten off of the language connection context.
tc
)

Get the target schema by searching for a matching row in SYSSCHEMAS by schema name.

private SchemaDescriptor
locateSchemaRowBody(UUID schemaId, int isolationLevel, TransactionController tc)

private void
makeCatalog(TabInfoImpl
TabInfoImpl describing catalog to create.
ti
,
SchemaDescriptor
Schema to create catalogs in.
sd
,
TransactionController
Transaction context.
tc
)

The dirty work of creating a catalog.

private ColumnDescriptor

Returns:

a ColumnDes*criptor
makeColumnDescriptor
(SystemColumn
a SystemColumn
column
,
int
Position of the column in the table, one based.
columnPosition
,
TableDescriptor
descriptor for table that column lives in
td
)

Converts a SystemColumn to a ColumnDescriptor.

public PasswordHasher
makePasswordHasher(Dictionary<?, ?>
The persistent properties used to configure password hashing.
props
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.makePasswordHasher.

Get the default password hasher for this database level.

public Cacheable
private SchemaDescriptor
private static <T> List<T>
private SchemaDescriptor
public Long
peekAtIdentity(String schemaName, String tableName)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.peekAtIdentity.

Peek at the next value which will be returned by an identity generator.

public Long
peekAtSequence(String schemaName, String sequenceName)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.peekAtSequence.

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

public void
resetDatabaseOwner(TransactionController
TransactionController
tc
)

Reset the database owner according to what is stored in the catalogs.

private void
rewriteSYSCOLPERMSforAlterTable(UUID
The UUID of the table being altered
tableID
,
TransactionController
TransactionController for the transaction
tc
,
ColumnDescriptor
Dropped column info, or null if adding
columnDescriptor
)

Workhorse for ALTER TABLE-driven mods to SYSCOLPERMS This method finds all the SYSCOLPERMS rows for this table.

public final Properties
run()

public void
setAutoincrementValue(TransactionController
Transaction Controller to use.
tc
,
UUID
Table Descriptor
tableUUID
,
String
Name of the column.
columnName
,
long
Value to write to SYSCOLUMNS.
aiValue
,
boolean
whether to increment the value passed in by the user (aiValue) or not before writing it to SYSCOLUMNS.
incrementNeeded
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.setAutoincrementValue.

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.

pack-priv void
setReadOnlyUpgrade()

Mark this database as a read only database whose stored prepared statements are invalid because some kind of upgrade is needed.

pack-priv void
spsCacheEntryAdded(SPSDescriptor spsd)

Add an entry to the hashtables for lookup from the cache.

pack-priv void
public int
startReading(LanguageConnectionContext
The LanguageConnectionContext to use.
lcc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.startReading.

Inform this DataDictionary that we are about to start reading it.

private static Object
startSystemModule(final String factoryInterface)

Must be private so that user code can't call this entry point.

public void
startWriting(LanguageConnectionContext
The LanguageConnectionContext to use.
lcc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.startWriting.

Inform this DataDictionary that we are about to start writing to it.

public void
public void
transactionFinished()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.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 String
twoDigits(int val)

private void
updateColumnDescriptor(ColumnDescriptor
The ColumnDescriptor
cd
,
UUID
The UUID for this column in SYSCOLUMNS, may differ from what is in cd if this is the column that is being set.
formerUUID
,
String
The name for this column in SYSCOLUMNS may differ from what is in cd if this is the column that is being set.
formerName
,
int[]
Array of ints of columns to be modified, 1 based. May be null (all cols).
colsToSet
,
TransactionController
The TransactionController to use
tc
)

Update the column descriptor in question.

public void
updateConglomerateDescriptor(ConglomerateDescriptor
The ConglomerateDescriptor
cd
,
long
The new conglomerate number
conglomerateNumber
,
TransactionController
The TransactionController to use
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.updateConglomerateDescriptor.

Update the conglomerateNumber for a ConglomerateDescriptor.

public void
updateConglomerateDescriptor(ConglomerateDescriptor[]
The array of ConglomerateDescriptors
cds
,
long
The new conglomerate number
conglomerateNumber
,
TransactionController
The TransactionController to use
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.updateConglomerateDescriptor.

Update the conglomerateNumber for an array of ConglomerateDescriptors.

public void
updateConstraintDescriptor(ConstraintDescriptor
The Constraint descriptor
cd
,
UUID
The UUID for this column in SYSCONSTRAINTS, may differ from what is in cd if this is the column that is being set.
formerUUID
,
int[]
Array of integers of columns to be modified, 1 based. May be null (all columns).
colsToSet
,
TransactionController
The TransactionController to use
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.updateConstraintDescriptor.

Update the constraint descriptor in question.

public boolean

Returns:

Returns true if the value was successfully updated, false if we lost a race with another session.
updateCurrentSequenceValue
(TransactionController
Transaction Controller to use.
tc
,
RowLocation
Row in SYSSEQUENCES to update.
rowLocation
,
boolean
True if we should wait for locks
wait
,
Long
What we expect to find in the CURRENTVALUE column.
oldValue
,
Long
What to stuff into the CURRENTVALUE column.
newValue
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.updateCurrentSequenceValue.

Set the current value of an ANSI/ISO sequence.

public void
updateLockGranularity(TableDescriptor
The TableDescriptor for the table
td
,
SchemaDescriptor
The SchemaDescriptor for the table
schema
,
char
The new lockGranularity
lockGranularity
,
TransactionController
The TransactionController to use.
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.updateLockGranularity.

Update the lockGranularity for the specified table.

public void
updateMetadataSPSes(TransactionController
the xact
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.updateMetadataSPSes.

Drop and recreate metadata stored prepared statements.

public void
updateSchemaAuth(String
Schema Name of system schema
schemaName
,
String
authorizationId of new schema owner
authorizationId
,
TransactionController
The TransactionController to use
tc
)

Update authorizationId of specified schemaName

public void
updateSPS(SPSDescriptor
The descriptor to add
spsd
,
TransactionController
The transaction controller
tc
,
boolean
Whether to recompile or invalidate
recompile
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.updateSPS.

Updates SYS.SYSSTATEMENTS with the info from the SPSD.

public void
updateSYSCOLPERMSforAddColumnToUserTable(UUID
The UUID of the table to which a column has been added
tableID
,
TransactionController
TransactionController for the transaction
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.updateSYSCOLPERMSforAddColumnToUserTable.

Need to update SYSCOLPERMS for a given table because a new column has been added to that table.

public void
updateSYSCOLPERMSforDropColumn(UUID
The UUID of the table from which a col has been dropped
tableID
,
TransactionController
TransactionController for the transaction
tc
,
ColumnDescriptor
Information about the dropped column
columnDescriptor
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.updateSYSCOLPERMSforDropColumn.

Update SYSCOLPERMS due to dropping a column from a table.

public void
updateSystemSchemaAuthorization(String
AuthorizationID of Database Owner
aid
,
TransactionController
TransactionController to use
tc
)

Update all system schemas to have new authorizationId.

public void
updateTriggerDescriptor(TriggerDescriptor
The Trigger descriptor
triggerd
,
UUID
The UUID for this column in SYSTRIGGERS, may differ from what is in triggerd if this is the column that is being set.
formerUUID
,
int[]
Array of ints of columns to be modified, 1 based. May be null (all cols).
colsToSet
,
TransactionController
The TransactionController to use
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.updateTriggerDescriptor.

Update the trigger descriptor in question.

public void
updateUser(UserDescriptor
New values for columns in the SYSUSERS row.
newDescriptor
,
TransactionController
The TransactionController to use
tc
)

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.updateUser.

Update a user.

public void
upgrade_addColumns(CatalogRowFactory
Associated with this catalog.
rowFactory
,
int[]
Array of 1-based column ids.
newColumnIDs
,
TransactionController
Transaction controller
tc
)

Upgrade an existing catalog by adding columns.

public void
upgrade_addInvisibleColumns(CatalogRowFactory
Associated with this catalog.
rowFactory
,
int[]
Array of 1-based column ids.
newColumnIDs
,
TransactionController
Transaction controller
tc
)

Add invisible columns to an existing system catalog

pack-priv void
upgrade_initSystemTableCols(TransactionController
The TransactionController for the transaction to do the upgrade in.
tc
,
boolean
true if it is a core table
isCoreTable
,
int
the noncore table number
tableNum
,
FormatableBitSet
a bit set of columns to update. ZERO BASED
columnsToUpdateSet
,
DataValueDescriptor[]
an object array of Orderables for the new values
replaceRow
)

Initialize noncore columns to fixed values

pack-priv void
upgrade_SYSCOLUMNS_AUTOINCCYCLE(TransactionController
Transaction controller.
tc
)

Add autoinccycle columns to an SYSCOLUMNS system catalog

pack-priv void
upgradeCLOBGETSUBSTRING_10_6(TransactionController tc)

10.6 upgrade logic to update the return type of SYSIBM.CLOBGETSUBSTRING.

public void
upgradeFixSystemColumnDefinition(CatalogRowFactory rowFactory, int
The column to change
columnNumber
,
TransactionController
Transaction controller
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
TransactionController to use.
tc
)

Called by the upgrade code to upgrade the way we store jar files in the database.

protected void
upgradeMakeCatalog(TransactionController
TransactionController to use.
tc
,
int
catalogNumber
catalogNumber
)

called by the upgrade code (dd_xena etc) to add a new system catalog.

pack-priv void
upgradeSYSROUTINEPERMS_10_6(TransactionController tc)

10.6 upgrade logic to update the permissions granted to SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE.

public boolean
usesSqlAuthorization()

Implements org.apache.derby.iapi.sql.dictionary.DataDictionary.usesSqlAuthorization.

Get authorization model in force, SqlStandard or legacy mode

private boolean

Returns:

action=EXISTS: return true if there is a matching row else return false.
visitPermsByGrantee
(String
grantee to match against
authId
,
TransactionController
transaction controller
tc
,
int
the underlying permission table to visit
catalog
,
int
the number of the index by which to access the catalog
indexNo
,
int
the column number to match authId against
granteeColnoInIndex
,
int
drop matching rows (DROP), or return true if there is a matching row (EXISTS)
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

Returns:

action=EXISTS: return true if there is a matching row else return false.
visitRoleGrants
(TabInfoImpl
TabInfoImpl for SYSROLES.
ti
,
SYSROLESRowFactory
row factory for SYSROLES
rf
,
int
the column number to match authId against
columnNo
,
String authId, TransactionController
transaction controller
tc
,
int
drop matching rows (DROP), or return true if there is a matching row (EXISTS)
action
)

Scan the {roleid, grantee, grantor} index on SYSROLES, locate rows containing authId in column columnNo.

private void
widenConglomerate(ExecRow
Ultimate shape of base row of table
templateRow
,
int[]
Array of 1-based column ids
newColumnIDs
,
long
heap id
conglomID
,
TransactionController
Transaction controller
tc
)

Adds columns to the conglomerate underlying a system table.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait