[
https://issues.apache.org/jira/browse/DERBY-481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rick Hillegas updated DERBY-481:
--------------------------------
Attachment: derby-481-00-aa-prototype.diff
Attaching a prototype implementation of basic machinery for generated columns.
I intend to split this up into smaller chunks that are easier to review. This
patch provides basic support for declaring generated columns and for populating
them at insert/update time.
o Basic tests written for:
- CREATE TABLE
- Cooperation of INSERT/UPDATE with constraints, triggers, and indexes
o Known not to work:
- Omitting the column datatype when declaring a generation clause
o Not tested at all:
- Schema evolution and statement invalidation
- Permissions
- dblook
- Upgrade
Contents of the patch:
UTILITIES, MESSAGES, TESTS
M java/engine/org/apache/derby/iapi/util/StringUtil.java
M java/engine/org/apache/derby/loc/messages.xml
M java/shared/org/apache/derby/shared/common/reference/SQLState.java
M
java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java
CATALOG SUPPORT
M java/engine/org/apache/derby/catalog/DefaultInfo.java
M java/engine/org/apache/derby/catalog/types/DefaultInfoImpl.java
M java/engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java
M java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java
DECLARING GENERATED COLUMNS
M java/engine/org/apache/derby/impl/sql/compile/NodeFactoryImpl.java
M java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
M java/engine/org/apache/derby/impl/sql/compile/DDLStatementNode.java
M java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java
M java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java
M java/engine/org/apache/derby/impl/sql/compile/C_NodeNames.java
M java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java
M java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java
M java/engine/org/apache/derby/impl/sql/compile/TableElementList.java
A java/engine/org/apache/derby/impl/sql/compile/GenerationClauseNode.java
M java/engine/org/apache/derby/iapi/sql/compile/C_NodeTypes.java
M java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java
INSERTING GENERATED COLUMNS
M java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
M java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java
M java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java
M java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java
M java/engine/org/apache/derby/impl/sql/compile/ExpressionClassBuilder.java
M java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
M java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java
M java/engine/org/apache/derby/impl/sql/compile/ValueNode.java
M
java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
M java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
M java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
M java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java
UPDATING GENERATED COLUMNS
M java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
M java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java
M java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java
M java/engine/org/apache/derby/impl/sql/GenericActivationHolder.java
M java/engine/org/apache/derby/iapi/sql/Activation.java
> implement SQL generated columns
> -------------------------------
>
> Key: DERBY-481
> URL: https://issues.apache.org/jira/browse/DERBY-481
> Project: Derby
> Issue Type: New Feature
> Components: SQL
> Affects Versions: 10.0.2.1
> Reporter: Rick Hillegas
> Attachments: derby-481-00-aa-prototype.diff, GeneratedColumns.html
>
>
> Satheesh has pointed out that generated columns, a SQL 2003 feature, would
> satisfy the performance requirements of Expression Indexes (bug 455).
> Generated columns may not be as elegant as Expression Indexes, but they are
> easier to implement. We would allow the following new kind of column
> definition in CREATE TABLE and ALTER TABLE statements:
> columnName GENERATED ALWAYS AS ( expression )
> If expression were an indexableExpression (as defined in bug 455), then we
> could create indexes on it. There is no work for the optimizer to do here.
> The Language merely has to compute the generated column at INSERT/UPDATE time.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.