Visitableclass DeleteNode extends DMLModStatementNode
| Modifier and Type | Field | Description |
|---|---|---|
private boolean |
cascadeDelete |
|
private static java.lang.String |
COLUMNNAME |
|
private boolean |
deferred |
|
private ConstantAction[] |
dependentConstantActions |
|
private StatementNode[] |
dependentNodes |
|
private FormatableBitSet |
readColsBitSet |
|
private FromTable |
targetTable |
dependentTables, fkColArrays, fkColDescriptors, fkIndexConglomNumbers, fkInfo, fkRefActions, fkSchemaNames, fkTableNames, indexConglomerateNumbers, indexNames, indicesToMaintain, isDependentTable, lockMode, matchingClause, relevantCdl, relevantTriggers, resultColumnList, synonymTableName, targetTableDescriptor, targetTableName, targetVTI, triggerInforesultSetAUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEXEMPTY_TD_LIST, NEED_CURSOR_ACTIVATION, NEED_DDL_ACTIVATION, NEED_NOTHING_ACTIVATION, NEED_PARAM_ACTIVATION, NEED_ROW_ACTIVATION| Constructor | Description |
|---|---|
DeleteNode(TableName targetTableName,
ResultSetNode queryExpression,
MatchingClauseNode matchingClause,
ContextManager cm) |
Constructor for a DeleteNode.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
bindStatement() |
Bind this DeleteNode.
|
private void |
correlateAddedColumns(ResultColumnList rcl,
FromTable fromTable) |
|
(package private) void |
generate(ActivationClassBuilder acb,
MethodBuilder mb) |
Code generation for delete.
|
private static FormatableBitSet |
getDeleteReadMap(TableDescriptor baseTable,
java.util.List<ConglomerateDescriptor> conglomerates,
TriggerDescriptorList relevantTriggers,
boolean[] needsDeferredProcessing) |
Builds a bitmap of all columns which should be read from the
Store in order to satisfy an DELETE statement.
1) finds all indices on this table
2) adds the index columns to a bitmap of affected columns
3) adds the index descriptors to a list of conglomerate
descriptors.
4) finds all DELETE triggers on the table
5) if there are any DELETE triggers, then do one of the following
a)If all of the triggers have MISSING referencing clause, then that
means that the trigger actions do not have access to before and
after values.
|
private StatementNode |
getDependentTableNode(java.lang.String schemaName,
java.lang.String tableName,
int refAction,
ColumnDescriptorList cdl) |
In case of referential actions, we require to perform
DML (UPDATE or DELETE) on the dependent tables.
|
private DeleteNode |
getEmptyDeleteNode(java.lang.String schemaName,
java.lang.String targetTableName) |
|
private UpdateNode |
getEmptyUpdateNode(java.lang.String schemaName,
java.lang.String targetTableName,
ColumnDescriptorList cdl) |
|
(package private) int |
getPrivType() |
Return default privilege needed for this node.
|
FormatableBitSet |
getReadMap(DataDictionary dd,
TableDescriptor baseTable) |
Gets the map of all columns which must be read out of the base table.
|
private ResultColumnList |
getSetClause(ColumnDescriptorList cdl) |
|
protected int |
getStatementType() |
Return the type of statement, something from
StatementType.
|
ConstantAction |
makeConstantAction() |
Compile constants that Execution will use
|
void |
optimizeStatement() |
Generate an optimized QueryTree from a bound QueryTree.
|
boolean |
referencesSessionSchema() |
Return true if the node references SESSION schema tables (temporary or permanent)
|
(package private) java.lang.String |
statementToString() |
acceptChildren, adjustDeferredFlag, bindConstraints, bindRowScopedExpression, generateCheckConstraints, generateCheckConstraints, generateCodeForTemporaryTable, generateGenerationClauses, getAffectedIndexes, getAllRelevantConstraints, getAllRelevantTriggers, getCheckConstraints, getFKInfo, getReadColMap, getResultColumnList, getResultColumnList, getSchemaDescriptor, getTriggerInfo, getXAffectedIndexes, hasCheckConstraints, hasGenerationClauses, inMatchingClause, isAtomic, markAffectedIndexes, normalizeSynonymColumns, parseAndBindGenerationClauses, parseCheckConstraint, parseGenerationClause, printSubNodes, requiresDeferredProcessing, setRefActionInfo, setTarget, verifyTargetTableactivationKind, bind, bindExpressions, bindExpressionsWithTables, bindResultSetsWithTables, bindTables, generateParameterValueSet, getResultSetNode, makeResultDescriptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaccept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getTableDescriptor, getTypeCompiler, getUDTDesc, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, resolveTableToSynonym, setBeginOffset, setEndOffset, stackPrint, taggedWith, treePrint, treePrint, verifyClassExistexecuteSchemaName, executeStatementName, generate, getCursorInfo, getSPSName, lockTableForCompilation, needsSavepoint, toString, updateIndexStatisticsForprivate static final java.lang.String COLUMNNAME
private boolean deferred
private FromTable targetTable
private FormatableBitSet readColsBitSet
private ConstantAction[] dependentConstantActions
private boolean cascadeDelete
private StatementNode[] dependentNodes
DeleteNode(TableName targetTableName, ResultSetNode queryExpression, MatchingClauseNode matchingClause, ContextManager cm)
targetTableName - The name of the table to delete fromqueryExpression - The query expression that will generate
the rows to delete from the given tablematchingClause - Non-null if this DML is part of a MATCHED clause of a MERGE statement.cm - The context managerjava.lang.String statementToString()
statementToString in class DMLModStatementNodepublic void bindStatement()
throws StandardException
If any indexes need to be updated, we add all the columns in the base table to the result column list, so that we can use the column values as look-up keys for the index rows to be deleted. Binding a delete will also massage the tree so that the ResultSetNode has column containing the RowLocation of the base row.
bindStatement in class StatementNodeStandardException - Thrown on errorint getPrivType()
DMLStatementNodegetPrivType in class DMLStatementNodepublic boolean referencesSessionSchema()
throws StandardException
referencesSessionSchema in class QueryTreeNodeStandardException - Thrown on errorpublic ConstantAction makeConstantAction() throws StandardException
makeConstantAction in class QueryTreeNodeStandardException - Thrown on failurevoid generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
generate in class QueryTreeNodeacb - The ActivationClassBuilder for the class being builtmb - The execute() method to be builtStandardException - Thrown on errorprotected final int getStatementType()
getStatementType in class QueryTreeNodepublic FormatableBitSet getReadMap(DataDictionary dd, TableDescriptor baseTable) throws StandardException
dd - the data dictionary to look inbaseTable - the base table descriptorStandardException - Thrown on errorprivate StatementNode getDependentTableNode(java.lang.String schemaName, java.lang.String tableName, int refAction, ColumnDescriptorList cdl) throws StandardException
StandardExceptionprivate DeleteNode getEmptyDeleteNode(java.lang.String schemaName, java.lang.String targetTableName) throws StandardException
StandardExceptionprivate UpdateNode getEmptyUpdateNode(java.lang.String schemaName, java.lang.String targetTableName, ColumnDescriptorList cdl) throws StandardException
StandardExceptionprivate ResultColumnList getSetClause(ColumnDescriptorList cdl) throws StandardException
StandardExceptionpublic void optimizeStatement()
throws StandardException
DMLModStatementNodeoptimizeStatement in class DMLModStatementNodeStandardException - Thrown on failureprivate static FormatableBitSet getDeleteReadMap(TableDescriptor baseTable, java.util.List<ConglomerateDescriptor> conglomerates, TriggerDescriptorList relevantTriggers, boolean[] needsDeferredProcessing) throws StandardException
conglomerates - OUT: list of affected indicesrelevantTriggers - IN/OUT. Passed in as an empty list. Filled in as we go.needsDeferredProcessing - IN/OUT. true if the statement already needs
deferred processing. set while evaluating this
routine if a trigger requires
deferred processingStandardException - Thrown on errorprivate void correlateAddedColumns(ResultColumnList rcl, FromTable fromTable) throws StandardException
StandardExceptionApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.