public interface CompilerContext extends Context
Modifier and Type | Field and Description |
---|---|
static int |
AGGREGATE_RESTRICTION |
static int |
CASE_OPERAND_RESTRICTION |
static int |
CHECK_CONSTRAINT |
static int |
COLUMN_REFERENCE_ILLEGAL |
static int |
CONDITIONAL_RESTRICTION |
static java.lang.String |
CONTEXT_ID
this is the ID we expect compiler contexts
to be stored into a context manager under.
|
static int |
CURRENT_CONNECTION_ILLEGAL |
static int |
DATETIME_ILLEGAL |
static int |
DEFAULT_RESTRICTION |
static int |
DIAGNOSTICS_ILLEGAL |
static int |
FUNCTION_CALL_ILLEGAL |
static int |
GENERATION_CLAUSE_RESTRICTION |
static int |
GROUP_BY_RESTRICTION |
static int |
HAVING_CLAUSE_RESTRICTION |
static int |
IGNORE_MISSING_CLASSES |
static int |
INTERNAL_SQL_ILLEGAL |
static int |
INTERNAL_SQL_LEGAL
Any SQL we support is legal
|
static int |
MODIFIES_SQL_DATA_PROCEDURE_ILLEGAL
Calling procedures that modify sql data from before triggers is illegal.
|
static int |
NEXT_VALUE_FOR_ILLEGAL |
static int |
NON_DETERMINISTIC_ILLEGAL |
static int |
ON_CLAUSE_RESTRICTION |
static int |
SCHEMA_ILLEGAL |
static int |
SQL_IN_ROUTINES_ILLEGAL |
static int |
SQL_LEGAL
Standard SQL is legal
|
static int |
SUBQUERY_ILLEGAL |
static int |
UNNAMED_PARAMETER_ILLEGAL |
static int |
USER_ILLEGAL |
static int |
WHERE_CLAUSE_RESTRICTION |
static java.lang.String |
WHERE_SCOPE |
Modifier and Type | Method and Description |
---|---|
void |
addPrivilegeFilter(VisitableFilter vf)
Add a filter for determining which QueryTreeNodes give rise to privilege checks
at run time.
|
void |
addReferencedSequence(SequenceDescriptor sd)
Add a sequence descriptor to the list of referenced sequences.
|
void |
addRequiredColumnPriv(ColumnDescriptor column)
Add a column privilege to the list of used column privileges.
|
void |
addRequiredRolePriv(java.lang.String roleName,
int privType)
Add a required role privilege to the list of privileges.
|
void |
addRequiredRoutinePriv(AliasDescriptor routine)
Add a routine execute privilege to the list of used routine privileges.
|
void |
addRequiredSchemaPriv(java.lang.String schema,
java.lang.String aid,
int privType)
Add a schema privilege to the list of used privileges.
|
void |
addRequiredTablePriv(TableDescriptor table)
Add a table or view privilege to the list of used table privileges.
|
void |
addRequiredUsagePriv(PrivilegedSQLObject usableObject)
Add a usage privilege to the list of required privileges.
|
int |
addSavedObject(java.lang.Object o)
Add an object to the pool that is created at compile time
and used at execution time.
|
void |
addWarning(java.sql.SQLWarning warning)
Add a compile time warning.
|
void |
beginScope(java.lang.String scopeName)
Record that the compiler is entering a named scope.
|
void |
createDependency(Dependent d,
Provider p)
Add a dependency between two objects.
|
void |
createDependency(Provider p)
Add a dependency for the current dependent.
|
void |
endScope(java.lang.String scopeName)
Record that the compiler is exiting a named scope.
|
void |
firstOnStack()
Mark this CompilerContext as the first on the stack, so we can avoid
continually popping and pushing a CompilerContext.
|
ClassFactory |
getClassFactory()
Return the class factory to use in this compilation.
|
SchemaDescriptor |
getCompilationSchema()
Get the compilation schema descriptor for this compilation context.
|
ProviderList |
getCurrentAuxiliaryProviderList()
Get the current auxiliary provider list from this CompilerContext.
|
java.lang.Object |
getCursorInfo()
Get the cursor info stored in the context.
|
boolean |
getInUse()
Return the in use state for the compiler context.
|
JavaFactory |
getJavaFactory()
Get the JavaFactory from this CompilerContext.
|
int |
getNextColumnNumber()
Get the current next column number (for generated column names)
from this CompilerContext.
|
int |
getNextEquivalenceClass()
Get the next equivalence class for equijoin clauses.
|
int |
getNextResultSetNumber()
Get the current next ResultSet number from this CompilerContext.
|
int |
getNextSubqueryNumber()
Get the current next subquery number from this CompilerContext.
|
int |
getNextTableNumber()
Get the current next table number from this CompilerContext.
|
int |
getNumResultSets()
Get the number of Results in the current statement from this CompilerContext.
|
int |
getNumSubquerys()
Get the number of subquerys in the current statement from this CompilerContext.
|
int |
getNumTables()
Get the number of tables in the current statement from this CompilerContext.
|
OptimizerFactory |
getOptimizerFactory()
Get the OptimizerFactory from this CompilerContext.
|
java.util.List<ParameterNode> |
getParameterList()
Get the parameter list.
|
Parser |
getParser()
Get the Parser from this CompilerContext
|
int |
getReliability()
Return the reliability requirements of this clause.
|
java.util.List<StatementPermission> |
getRequiredPermissionsList() |
boolean |
getReturnParameterFlag()
Is the callable statement uses ?
|
java.lang.Object[] |
getSavedObjects()
Get the saved object pool (for putting into the prepared statement).
|
int |
getScanIsolationLevel()
Get the isolation level for the scans in this query.
|
SortCostController |
getSortCostController()
Get a SortCostController.
|
StoreCostController |
getStoreCostController(long conglomerateNumber)
Get a StoreCostController for the given conglomerate.
|
TypeCompilerFactory |
getTypeCompilerFactory()
Get the TypeCompilerFactory from this CompilerContext.
|
java.lang.String |
getUniqueClassName()
Get a unique Class name from this CompilerContext.
|
java.sql.SQLWarning |
getWarnings()
Get the chain of compile time warnings.
|
boolean |
isFirstOnStack()
Is this the first CompilerContext on the stack?
|
boolean |
isReferenced(SequenceDescriptor sd)
Report whether the given sequence has been referenced already.
|
boolean |
passesPrivilegeFilters(Visitable visitable)
Return true if a QueryTreeNode passes all of the filters which determine whether
the QueryTreeNode gives rise to run time privilege checks.
|
void |
popCompilationSchema()
Pop the default schema to use when compiling.
|
void |
popCurrentPrivType() |
void |
pushCompilationSchema(SchemaDescriptor sd)
Push a default schema to use when compiling.
|
void |
pushCurrentPrivType(int privType)
Sets the current privilege type context and pushes the previous on onto a stack.
|
void |
removePrivilegeFilter(VisitableFilter vf)
Remove a filter for determining which QueryTreeNodes give rise to privilege
checks at run time.
|
void |
resetContext()
Reset compiler context (as for instance, when we recycle a context for
use by another compilation.
|
void |
resetNextResultSetNumber()
Reset the next ResultSet number from this CompilerContext.
|
int |
scopeDepth(java.lang.String scopeName)
Get the current depth for the named scope.
|
SchemaDescriptor |
setCompilationSchema(SchemaDescriptor newDefault)
Set the compilation schema descriptor for this compilation context.
|
void |
setCurrentAuxiliaryProviderList(ProviderList apl)
Set the current auxiliary provider list for this CompilerContext.
|
void |
setCurrentDependent(Dependent d)
Set the current dependent from this CompilerContext.
|
void |
setCursorInfo(java.lang.Object cursorInfo)
Set params
|
void |
setInUse(boolean inUse)
Set the in use state for the compiler context.
|
void |
setParameterList(java.util.List<ParameterNode> parameterList)
Set the parameter list.
|
void |
setReliability(int reliability)
Sets which kind of query fragments are NOT allowed.
|
void |
setReturnParameterFlag()
If callable statement uses ?
|
void |
setSavedObjects(java.util.List<java.lang.Object> objs)
Set the saved object pool (for putting into the prepared statement).
|
void |
setScanIsolationLevel(int isolationLevel)
Set the isolation level for the scans in this query.
|
boolean |
skippingTypePrivileges()
Return whether we are skipping USAGE privileges for user-defined types
|
boolean |
skipTypePrivileges(boolean skip)
Set whether we should skip adding USAGE privileges for user-defined types.
|
cleanupOnError, getContextManager, getIdName, isLastHandler, popMe, pushMe
static final java.lang.String CONTEXT_ID
static final int DATETIME_ILLEGAL
static final int CURRENT_CONNECTION_ILLEGAL
static final int FUNCTION_CALL_ILLEGAL
static final int UNNAMED_PARAMETER_ILLEGAL
static final int DIAGNOSTICS_ILLEGAL
static final int SUBQUERY_ILLEGAL
static final int USER_ILLEGAL
static final int COLUMN_REFERENCE_ILLEGAL
static final int IGNORE_MISSING_CLASSES
static final int SCHEMA_ILLEGAL
static final int INTERNAL_SQL_ILLEGAL
static final int MODIFIES_SQL_DATA_PROCEDURE_ILLEGAL
static final int NON_DETERMINISTIC_ILLEGAL
static final int SQL_IN_ROUTINES_ILLEGAL
static final int NEXT_VALUE_FOR_ILLEGAL
static final int SQL_LEGAL
static final int INTERNAL_SQL_LEGAL
static final int CHECK_CONSTRAINT
static final int DEFAULT_RESTRICTION
static final int GENERATION_CLAUSE_RESTRICTION
static final int WHERE_CLAUSE_RESTRICTION
static final int HAVING_CLAUSE_RESTRICTION
static final int ON_CLAUSE_RESTRICTION
static final int AGGREGATE_RESTRICTION
static final int CONDITIONAL_RESTRICTION
static final int GROUP_BY_RESTRICTION
static final int CASE_OPERAND_RESTRICTION
static final java.lang.String WHERE_SCOPE
Parser getParser()
OptimizerFactory getOptimizerFactory()
TypeCompilerFactory getTypeCompilerFactory()
ClassFactory getClassFactory()
JavaFactory getJavaFactory()
int getNextColumnNumber()
void resetContext()
int getNextTableNumber()
int getNumTables()
int getNextSubqueryNumber()
int getNumSubquerys()
int getNextResultSetNumber()
void resetNextResultSetNumber()
int getNumResultSets()
java.lang.String getUniqueClassName()
void setCurrentDependent(Dependent d)
d
- The Dependent currently being compiled.ProviderList getCurrentAuxiliaryProviderList()
void setCurrentAuxiliaryProviderList(ProviderList apl)
apl
- The new current AuxiliaryProviderList.void createDependency(Provider p) throws StandardException
p
- The Provider of the dependency.StandardException
- thrown on failure.void createDependency(Dependent d, Provider p) throws StandardException
d
- The Dependent object.p
- The Provider of the dependency.StandardException
- thrown on failure.int addSavedObject(java.lang.Object o)
(#objectType) (this.getPreparedStatement().getSavedObject(#int))
o
- object to add to the pool of saved objectsjava.lang.Object[] getSavedObjects()
void setSavedObjects(java.util.List<java.lang.Object> objs)
objs
- The new saved objectsjava.lang.NullPointerException
- if objs
is nullvoid setInUse(boolean inUse)
inUse
- The new inUse state for the compiler context.boolean getInUse()
void firstOnStack()
boolean isFirstOnStack()
void setReliability(int reliability)
reliability
- bitmask of types of query fragments to be forbidden
see the reliability bitmasks aboveint getReliability()
SchemaDescriptor getCompilationSchema()
SchemaDescriptor setCompilationSchema(SchemaDescriptor newDefault)
newDefault
- compilation schemavoid pushCompilationSchema(SchemaDescriptor sd)
Sometimes, we need to temporarily change the default schema, for example when recompiling a view, since the execution time default schema may differ from the required default schema when the view was defined. Another case is when compiling generated columns which reference unqualified user functions.
sd
- schema to usevoid popCompilationSchema()
StoreCostController getStoreCostController(long conglomerateNumber) throws StandardException
conglomerateNumber
- The conglomerate for which to get a
StoreCostController.StandardException
- Thrown on errorSortCostController getSortCostController() throws StandardException
StandardException
- Thrown on errorvoid setParameterList(java.util.List<ParameterNode> parameterList)
parameterList
- The parameter list.java.util.List<ParameterNode> getParameterList()
void setReturnParameterFlag()
boolean getReturnParameterFlag()
java.lang.Object getCursorInfo()
void setCursorInfo(java.lang.Object cursorInfo)
cursorInfo
- the cursor infovoid setScanIsolationLevel(int isolationLevel)
isolationLevel
- The isolation level to use.int getScanIsolationLevel()
int getNextEquivalenceClass()
void addWarning(java.sql.SQLWarning warning)
java.sql.SQLWarning getWarnings()
void pushCurrentPrivType(int privType)
privType
- One of the privilege types in
org.apache.derby.iapi.sql.conn.Authorizer.void popCurrentPrivType()
void addRequiredColumnPriv(ColumnDescriptor column)
column
- void addRequiredTablePriv(TableDescriptor table)
table
- void addRequiredSchemaPriv(java.lang.String schema, java.lang.String aid, int privType)
schema
- Schema name of the object that is being accessedaid
- Requested authorizationId for new schemaprivType
- CREATE_SCHEMA_PRIV, MODIFY_SCHEMA_PRIV or DROP_SCHEMA_PRIVvoid addRequiredRoutinePriv(AliasDescriptor routine)
routine
- void addRequiredUsagePriv(PrivilegedSQLObject usableObject)
usableObject
- void addRequiredRolePriv(java.lang.String roleName, int privType)
java.util.List<StatementPermission> getRequiredPermissionsList()
void addReferencedSequence(SequenceDescriptor sd)
boolean isReferenced(SequenceDescriptor sd)
void addPrivilegeFilter(VisitableFilter vf)
void removePrivilegeFilter(VisitableFilter vf)
boolean passesPrivilegeFilters(Visitable visitable) throws StandardException
StandardException
void beginScope(java.lang.String scopeName)
void endScope(java.lang.String scopeName)
int scopeDepth(java.lang.String scopeName)
boolean skipTypePrivileges(boolean skip)
boolean skippingTypePrivileges()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.