| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private TableDescriptor |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | addTableElement(TableElementNode
The TableElementNode to add to this list tableElement)Add a TableElementNode to this TableElementList |
| pack-priv void | appendNewColumnsToRCL(FromBaseTable
The table in question. table)Append goobered up ResultColumns to the table's RCL. |
| private boolean | Returns: true if any of the column can be null false other wiseConstraint node cdn, TableDescriptor tabe descriptor of the target table td)Checks if any of the columns in the constraint can be null. |
| pack-priv void | bindAndValidateCheckConstraints(FromList
The FromList in question. fromList)Bind and validate all of the check constraints in this list against the specified FromList. |
| pack-priv void | bindAndValidateGenerationClauses(SchemaDescriptor
Schema where the table lives. sd, FromList The FromList in question. fromList, FormatableBitSet Bitmap of generated columns in the table. Vacuous for CREATE TABLE, but may be non-trivial for ALTER TABLE. This routine may set bits for new generated columns. generatedColumns, TableDescriptor Table descriptor if this is an ALTER TABLE statement. baseTable)Bind and validate all of the generation clauses in this list against the specified FromList. |
| private void | checkForDuplicateColumns(DDLStatementNode
DDLStatementNode which contains this list ddlStmt, Set<String> The column names seen so far (for enforcing uniqueness) seenNames, String Column name to check for. colName)Check to make sure that there are no duplicate column names in the list. |
| private void | checkForDuplicateConstraintNames(DDLStatementNode
DDLStatementNode which contains this list ddlStmt, Set<String> The constraint names seen so far (for enforcing
uniqueness) seenNames, String constraintName)Check to make sure that there are no duplicate constraint names in the list. |
| private void | |
| private Properties | Returns: properties to use for creating the indexConstraint node cdn)Checks if the index should use a larger page size. |
| private boolean | |
| pack-priv boolean | Returns: boolean Whether or not a match is found.The column name to search for. colName)Determine whether or not the parameter matches a column name in this list. |
| pack-priv int | Returns: int The number of constraints of the specified type.The constraint type to search for. constraintType)Count the number of constraints of the specified type. |
| pack-priv int | |
| pack-priv int | |
| private ColumnDefinitionNode | Returns: Reference to column definition node or null if the column is not in the list.Find the column definition node in this list that matches the passed in column name. |
| pack-priv void | findIllegalGenerationReferences(FromList
The FromList in question. fromList, TableDescriptor Table descriptor if this is an ALTER TABLE statement. baseTable)Complain if a generation clause references other generated columns. |
| pack-priv int | Returns: int The number of constraints in the create table.The ColumnInfo[] to be filled in. colInfos)Fill in the ColumnInfo[] for this table element list. |
| pack-priv void | genConstraintActions(boolean
ConstraintConstantAction is for a create table. forCreateTable, ConstraintConstantAction[] The ConstraintConstantAction[] to be filled in. conActions, String The name of the Table being created. tableName, SchemaDescriptor The schema for that table. tableSd, DataDictionary The DataDictionary dd)Fill in the ConstraintConstantAction[] for this create/alter table. |
| private IndexConstantAction | genIndexAction(boolean
Executed as part of a CREATE TABLE forCreateTable, boolean True means it will be a unique index isUnique, boolean True means index check and disallow
any duplicate key if key has no
column with a null value. If any
column in the key has a null value,
no checking is done and insert will
always succeed. isUniqueWithDuplicateNulls, boolean True if index is used to back a
deferrable constraint hasDeferrableChecking, boolean True means the deferrable constraint
has deferred mode initiallyDeferred, String The type of index (BTREE, for
example) indexName, ConstraintDefinitionNode cdn, String[] Names of the columns in the index,
in order. columnNames, boolean TRUE if index is backing up a
constraint, else FALSE. isConstraint, SchemaDescriptor sd, String Name of table the index will be on tableName, int constraintType, DataDictionary dd)utility to generated the call to create the index. |
| private DataTypeDescriptor | |
| private DataTypeDescriptor | |
| pack-priv void | setCollationTypeOnCharacterStringColumn(SchemaDescriptor sd, ColumnDefinitionNode cdn)
Use the passed schema descriptor's collation type to set the collation of a character string column. |
| pack-priv void | setCollationTypesOnCharacterStringColumns(SchemaDescriptor sd)
Use the passed schema descriptor's collation type to set the collation of the character string types in create table node |
| private void | setColumnListToNotNull(ConstraintDefinitionNode
The ConstraintDefinitionNode for a PRIMARY KEY constraint cdn)Set all columns in that appear in a PRIMARY KEY constraint in a CREATE TABLE statement to NOT NULL. |
| pack-priv void | validate(DDLStatementNode
DDLStatementNode which contains this list ddlStmt, DataDictionary DataDictionary to use dd, TableDescriptor TableDescriptor for table, if existing table. td)Validate this TableElementList. |
| pack-priv void | validateForeignKeysOnGenerationClauses(FromList
The FromList in question. fromList, FormatableBitSet Bitmap of generated columns in the table. generatedColumns)Prevent foreign keys on generated columns from violating the SQL spec, part 2, section 11.8 (<column definition>), syntax rule 12: the referential action may not specify SET NULL or SET DEFAULT and the update rule may not specify ON UPDATE CASCADE. |
| public void | |
| private void | verifyUniqueColumnList(DDLStatementNode
The outer DDLStatementNode ddlStmt, ConstraintDefinitionNode The ConstraintDefinitionNode cdn)Verify that a primary/unique table constraint has a valid column list. |
| numColumns | back to summary |
|---|---|
| private int numColumns | |
| td | back to summary |
|---|---|
| private TableDescriptor td | |
| TableElementList | back to summary |
|---|---|
| public TableElementList(ContextManager cm) | |
| addTableElement | back to summary |
|---|---|
| pack-priv void addTableElement(TableElementNode tableElement) Add a TableElementNode to this TableElementList
| |
| appendNewColumnsToRCL | back to summary |
|---|---|
| pack-priv void appendNewColumnsToRCL(FromBaseTable table) throws StandardException Append goobered up ResultColumns to the table's RCL. This is useful for binding check constraints for CREATE and ALTER TABLE.
| |
| areColumnsNullable | back to summary |
|---|---|
| private boolean areColumnsNullable(ConstraintDefinitionNode cdn, TableDescriptor td) Checks if any of the columns in the constraint can be null.
| |
| bindAndValidateCheckConstraints | back to summary |
|---|---|
| pack-priv void bindAndValidateCheckConstraints(FromList fromList) throws StandardException Bind and validate all of the check constraints in this list against the specified FromList.
| |
| bindAndValidateGenerationClauses | back to summary |
|---|---|
| pack-priv void bindAndValidateGenerationClauses(SchemaDescriptor sd, FromList fromList, FormatableBitSet generatedColumns, TableDescriptor baseTable) throws StandardException Bind and validate all of the generation clauses in this list against the specified FromList.
| |
| checkForDuplicateColumns | back to summary |
|---|---|
| private void checkForDuplicateColumns(DDLStatementNode ddlStmt, Set<String> seenNames, String colName) throws StandardException Check to make sure that there are no duplicate column names in the list. (The comparison here is case sensitive. The work of converting column names that are not quoted identifiers to upper case is handled by the parser.) Resolve This check will also be performed by alter table.
| |
| checkForDuplicateConstraintNames | back to summary |
|---|---|
| private void checkForDuplicateConstraintNames(DDLStatementNode ddlStmt, Set<String> seenNames, String constraintName) throws StandardException Check to make sure that there are no duplicate constraint names in the list. (The comparison here is case sensitive. The work of converting column names that are not quoted identifiers to upper case is handled by the parser.) Resolve This check will also be performed by alter table.
| |
| checkForNullColumns | back to summary |
|---|---|
| private void checkForNullColumns(ConstraintDefinitionNode cdn, TableDescriptor td) throws StandardException | |
| checkIndexPageSizeProperty | back to summary |
|---|---|
| private Properties checkIndexPageSizeProperty(ConstraintDefinitionNode cdn) throws StandardException Checks if the index should use a larger page size. If the columns in the index are large, and if the user hasn't already specified a page size to use, then we may need to default to the large page size in order to get an index with sufficiently large pages. For example, this DDL should use a larger page size for the index that backs the PRIMARY KEY constraint: create table t (x varchar(1000) primary key)
| |
| columnsMatch | back to summary |
|---|---|
| private boolean columnsMatch(String[] columnNames1, String[] columnNames2) | |
| containsColumnName | back to summary |
|---|---|
| pack-priv boolean containsColumnName(String colName) Determine whether or not the parameter matches a column name in this list.
| |
| countConstraints | back to summary |
|---|---|
| pack-priv int countConstraints(int constraintType) Count the number of constraints of the specified type.
| |
| countGenerationClauses | back to summary |
|---|---|
| pack-priv int countGenerationClauses() Count the number of generation clauses. | |
| countNumberOfColumns | back to summary |
|---|---|
| pack-priv int countNumberOfColumns() Count the number of columns.
| |
| findColumnDefinition | back to summary |
|---|---|
| private ColumnDefinitionNode findColumnDefinition(String colName) Find the column definition node in this list that matches the passed in column name.
| |
| findIllegalGenerationReferences | back to summary |
|---|---|
| pack-priv void findIllegalGenerationReferences(FromList fromList, TableDescriptor baseTable) throws StandardException Complain if a generation clause references other generated columns. This is required by the SQL Standard, part 2, section 4.14.8.
| |
| genColumnInfos | back to summary |
|---|---|
| pack-priv int genColumnInfos(ColumnInfo[] colInfos) throws StandardException Fill in the ColumnInfo[] for this table element list.
| |
| genConstraintActions | back to summary |
|---|---|
| pack-priv void genConstraintActions(boolean forCreateTable, ConstraintConstantAction[] conActions, String tableName, SchemaDescriptor tableSd, DataDictionary dd) throws StandardException Fill in the ConstraintConstantAction[] for this create/alter table.
| |
| genIndexAction | back to summary |
|---|---|
| private IndexConstantAction genIndexAction(boolean forCreateTable, boolean isUnique, boolean isUniqueWithDuplicateNulls, boolean hasDeferrableChecking, boolean initiallyDeferred, String indexName, ConstraintDefinitionNode cdn, String[] columnNames, boolean isConstraint, SchemaDescriptor sd, String tableName, int constraintType, DataDictionary dd) throws StandardException utility to generated the call to create the index.
| |
| getColumnDataTypeDescriptor | back to summary |
|---|---|
| private DataTypeDescriptor getColumnDataTypeDescriptor(String colName) | |
| getColumnDataTypeDescriptor | back to summary |
|---|---|
| private DataTypeDescriptor getColumnDataTypeDescriptor(String colName, TableDescriptor td) | |
| setCollationTypeOnCharacterStringColumn | back to summary |
|---|---|
| pack-priv void setCollationTypeOnCharacterStringColumn(SchemaDescriptor sd, ColumnDefinitionNode cdn) throws StandardException Use the passed schema descriptor's collation type to set the collation of a character string column. | |
| setCollationTypesOnCharacterStringColumns | back to summary |
|---|---|
| pack-priv void setCollationTypesOnCharacterStringColumns(SchemaDescriptor sd) throws StandardException Use the passed schema descriptor's collation type to set the collation of the character string types in create table node | |
| setColumnListToNotNull | back to summary |
|---|---|
| private void setColumnListToNotNull(ConstraintDefinitionNode cdn) Set all columns in that appear in a PRIMARY KEY constraint in a CREATE TABLE statement to NOT NULL.
| |
| validate | back to summary |
|---|---|
| pack-priv void validate(DDLStatementNode ddlStmt, DataDictionary dd, TableDescriptor td) throws StandardException Validate this TableElementList. This includes checking for duplicate columns names, and checking that user types really exist.
| |
| validateForeignKeysOnGenerationClauses | back to summary |
|---|---|
| pack-priv void validateForeignKeysOnGenerationClauses(FromList fromList, FormatableBitSet generatedColumns) throws StandardException Prevent foreign keys on generated columns from violating the SQL spec,
part 2, section 11.8 ( The FromList in question.
Bitmap of generated columns in the table.
| |
| validatePrimaryKeyNullability | back to summary |
|---|---|
| public void validatePrimaryKeyNullability() throws StandardException Validate nullability of primary keys. This logic was moved out of the main validate method so that it can be called after binding generation clauses. We need to perform the nullability checks later on because the datatype may be omitted on the generation clause--we can't set/vet the nullability of the datatype until we determine what the datatype is. | |
| verifyUniqueColumnList | back to summary |
|---|---|
| private void verifyUniqueColumnList(DDLStatementNode ddlStmt, ConstraintDefinitionNode cdn) throws StandardException Verify that a primary/unique table constraint has a valid column list. (All columns in table and no duplicates.)
| |