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

pack-priv Class AlterTableNode

extends DDLStatementNode
Class Inheritance
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.Limits, .SQLState, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.compile.Visitor, org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor, .ConstraintDescriptorList, .DataDictionary, .SchemaDescriptor, .TableDescriptor, org.apache.derby.iapi.sql.execute.ConstantAction, org.apache.derby.impl.sql.execute.ColumnInfo, .ConstraintConstantAction, .CreateConstraintConstantAction

A AlterTableNode represents a DDL statement that alters a table. It contains the name of the object to be created.

Field Summary

Modifier and TypeField and Description
public TableDescriptor
public int
private int
protected ColumnInfo[]
public boolean
protected ConstraintConstantAction[]
public boolean
private boolean
dropStatistics

dropStatistics will indicate that we are here for dropping the statistics.

private boolean
dropStatisticsAll

The flag dropStatisticsAll will tell if we are going to drop the statistics of all indexes or just one index on a table.

private String
indexNameForStatistics

If statistic is getting updated/dropped for just one index, then indexNameForStatistics will tell the name of the specific index whose statistics need to be updated/dropped.

pack-priv char
protected int
public boolean
protected SchemaDescriptor
public boolean
public TableElementList
public boolean
private boolean
private boolean
updateStatistics

updateStatistics will indicate that we are here for updating the statistics.

private boolean
updateStatisticsAll

The flag updateStatisticsAll will tell if we are going to update the statistics of all indexes or just one index on a table.

Inherited from org.apache.derby.impl.sql.compile.DDLStatementNode:
ADD_TYPEDROP_STATISTICSDROP_TYPEimplicitCreateSchemaLOCKING_TYPEMODIFY_TYPEUNKNOWN_TYPEUPDATE_STATISTICS

Constructor Summary

AccessConstructor and Description
pack-priv
AlterTableNode(TableName
The name of the table being truncated
tableName
,
ContextManager
Context manager
cm
)

Constructor for TRUNCATE TABLE

pack-priv
AlterTableNode(TableName
The name of the table being altered
tableName
,
boolean
Whether or not the COMPRESS is SEQUENTIAL
sequential
,
ContextManager
Context manager
cm
)

Constructor for COMPRESS using temporary tables rather than in place compress

pack-priv
AlterTableNode(TableName
The name of the table being altered
tableName
,
boolean
PURGE during INPLACE COMPRESS?
purge
,
boolean
DEFRAGMENT during INPLACE COMPRESS?
defragment
,
boolean
TRUNCATE END during INPLACE COMPRESS?
truncateEndOfTable
,
ContextManager
Context manager
cm
)

Constructor for INPLACE COMPRESS

pack-priv
AlterTableNode(TableName
The name of the table being altered
tableName
,
int
update or drop statistics
changeType
,
boolean
true means update or drop the statistics of all the indexes on the table. false means update or drop the statistics of only the index name provided by next parameter.
statsAll
,
String
Name of the index for which statistics is to be updated or dropped
indexName
,
ContextManager
Context manager
cm
)

Constructor for UPDATE_STATISTICS or DROP_STATISTICS

pack-priv
AlterTableNode(TableName
The name of the table being altered
tableName
,
int
add, drop, modify or lock
changeType
,
TableElementList
list of table elements impacted
impactedElements
,
char
lock granularity encoded in a single character
lockGranularity
,
int
cascade or restrict (for DROP_TYPE)
behavior
,
ContextManager
Context Manager
cm
)

Constructor for ADD_TYPE, DROP_TYPE, MODIFY_TYPE and LOCK_TYPE

Method Summary

Modifier and TypeMethod and Description
pack-priv void
acceptChildren(Visitor
the visitor
v
)

Overrides org.apache.derby.impl.sql.compile.DDLStatementNode.acceptChildren.

Accept the visitor for all visitable children of this node.

public void
public void
genColumnInfo()

Generate the ColumnInfo argument for the constant action.

public int
public ConstantAction
makeConstantAction()

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.makeConstantAction.

Create the Constant information that will drive the guts of Execution.

private void
prepConstantAction()

Generate arguments to constant action.

pack-priv void
printSubNodes(int
The depth to indent the sub-nodes
depth
)

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.printSubNodes.

Prints the sub-nodes of this object.

public boolean

Returns:

true if references SESSION schema tables, else false
referencesSessionSchema
()

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.referencesSessionSchema.

Return true if the node references SESSION schema tables (temporary or permanent)

public String
public String

Returns:

This object as a String
toString
()

Overrides org.apache.derby.impl.sql.compile.DDLStatementNode.toString.

Convert this object to a String.

Inherited from org.apache.derby.impl.sql.compile.DDLStatementNode:
activationKindgenerategetFullNamegetObjectNamegetRelativeNamegetSchemaDescriptorgetSchemaDescriptorgetTableDescriptorgetTableDescriptorgetTableDescriptorgetTableDescriptorinitAndCheckisAtomicmakeFromList

Field Detail

baseTableback to summary
public TableDescriptor baseTable
behaviorback to summary
public int behavior
changeTypeback to summary
private int changeType
colInfosback to summary
protected ColumnInfo[] colInfos
compressTableback to summary
public boolean compressTable
conActionsback to summary
protected ConstraintConstantAction[] conActions
defragmentback to summary
public boolean defragment
dropStatisticsback to summary
private boolean dropStatistics

dropStatistics will indicate that we are here for dropping the statistics. It could be statistics of just one index or all the indexes on a given table.

dropStatisticsAllback to summary
private boolean dropStatisticsAll

The flag dropStatisticsAll will tell if we are going to drop the statistics of all indexes or just one index on a table.

indexNameForStatisticsback to summary
private String indexNameForStatistics

If statistic is getting updated/dropped for just one index, then indexNameForStatistics will tell the name of the specific index whose statistics need to be updated/dropped.

lockGranularityback to summary
pack-priv char lockGranularity
numConstraintsback to summary
protected int numConstraints
purgeback to summary
public boolean purge
schemaDescriptorback to summary
protected SchemaDescriptor schemaDescriptor
sequentialback to summary
public boolean sequential
tableElementListback to summary
public TableElementList tableElementList
truncateEndOfTableback to summary
public boolean truncateEndOfTable
truncateTableback to summary
private boolean truncateTable
updateStatisticsback to summary
private boolean updateStatistics

updateStatistics will indicate that we are here for updating the statistics. It could be statistics of just one index or all the indexes on a given table.

updateStatisticsAllback to summary
private boolean updateStatisticsAll

The flag updateStatisticsAll will tell if we are going to update the statistics of all indexes or just one index on a table.

Constructor Detail

AlterTableNodeback to summary
pack-priv AlterTableNode(TableName tableName, ContextManager cm) throws StandardException

Constructor for TRUNCATE TABLE

Parameters
tableName:TableName

The name of the table being truncated

cm:ContextManager

Context manager

AlterTableNodeback to summary
pack-priv AlterTableNode(TableName tableName, boolean sequential, ContextManager cm) throws StandardException

Constructor for COMPRESS using temporary tables rather than in place compress

Parameters
tableName:TableName

The name of the table being altered

sequential:boolean

Whether or not the COMPRESS is SEQUENTIAL

cm:ContextManager

Context manager

Exceptions
StandardException:
Thrown on error
AlterTableNodeback to summary
pack-priv AlterTableNode(TableName tableName, boolean purge, boolean defragment, boolean truncateEndOfTable, ContextManager cm) throws StandardException

Constructor for INPLACE COMPRESS

Parameters
tableName:TableName

The name of the table being altered

purge:boolean

PURGE during INPLACE COMPRESS?

defragment:boolean

DEFRAGMENT during INPLACE COMPRESS?

truncateEndOfTable:boolean

TRUNCATE END during INPLACE COMPRESS?

cm:ContextManager

Context manager

Exceptions
StandardException:
Thrown on error
AlterTableNodeback to summary
pack-priv AlterTableNode(TableName tableName, int changeType, boolean statsAll, String indexName, ContextManager cm) throws StandardException

Constructor for UPDATE_STATISTICS or DROP_STATISTICS

Parameters
tableName:TableName

The name of the table being altered

changeType:int

update or drop statistics

statsAll:boolean

true means update or drop the statistics of all the indexes on the table. false means update or drop the statistics of only the index name provided by next parameter.

indexName:String

Name of the index for which statistics is to be updated or dropped

cm:ContextManager

Context manager

AlterTableNodeback to summary
pack-priv AlterTableNode(TableName tableName, int changeType, TableElementList impactedElements, char lockGranularity, int behavior, ContextManager cm) throws StandardException

Constructor for ADD_TYPE, DROP_TYPE, MODIFY_TYPE and LOCK_TYPE

Parameters
tableName:TableName

The name of the table being altered

changeType:int

add, drop, modify or lock

impactedElements:TableElementList

list of table elements impacted

lockGranularity:char

lock granularity encoded in a single character

behavior:int

cascade or restrict (for DROP_TYPE)

cm:ContextManager

Context Manager

Method Detail

acceptChildrenback to summary
pack-priv void acceptChildren(Visitor v) throws StandardException

Overrides org.apache.derby.impl.sql.compile.DDLStatementNode.acceptChildren.

Accept the visitor for all visitable children of this node.

Parameters
v:Visitor

the visitor

Annotations
@Override
Exceptions
StandardException:
on error
bindStatementback to summary
public void bindStatement() throws StandardException

Overrides org.apache.derby.impl.sql.compile.StatementNode.bindStatement.

Bind this AlterTableNode. This means doing any static error checking that can be done before actually creating the table. For example, verifying that the user is not trying to add a non-nullable column.

Annotations
@Override
Exceptions
StandardException:
Thrown on error
genColumnInfoback to summary
public void genColumnInfo() throws StandardException

Generate the ColumnInfo argument for the constant action. Return the number of constraints.

getChangeTypeback to summary
public int getChangeType()
makeConstantActionback to summary
public ConstantAction makeConstantAction() throws StandardException

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.makeConstantAction.

Create the Constant information that will drive the guts of Execution.

Annotations
@Override
Exceptions
StandardException:
Thrown on failure
prepConstantActionback to summary
private void prepConstantAction() throws StandardException

Generate arguments to constant action. Called by makeConstantAction() in this class and in our subclass RepAlterTableNode.

Exceptions
StandardException:
Thrown on failure
printSubNodesback to summary
pack-priv void printSubNodes(int depth)

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.printSubNodes.

Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.

Parameters
depth:int

The depth to indent the sub-nodes

Annotations
@Override
referencesSessionSchemaback to summary
public boolean referencesSessionSchema() throws StandardException

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.referencesSessionSchema.

Return true if the node references SESSION schema tables (temporary or permanent)

Returns:boolean

true if references SESSION schema tables, else false

Annotations
@Override
Exceptions
StandardException:
Thrown on error
statementToStringback to summary
public String statementToString()

Implements abstract org.apache.derby.impl.sql.compile.StatementNode.statementToString.

toStringback to summary
public String toString()

Overrides org.apache.derby.impl.sql.compile.DDLStatementNode.toString.

Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Returns:String

This object as a String

Annotations
@Override