db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-481) implement SQL generated columns
Date Thu, 30 Oct 2008 21:10:44 GMT

     [ 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-07-aa-noSQLinRoutines.diff

Attaching derby-481-07-aa-noSQLinRoutines.diff. Tests are running now. This patch makes the
following changes:

1) Rejects generation clauses which contain user functions which may contain SQL, per the
functional spec.

2) Adds tests for the above change.

3) Adds tests to verify that aggregates are not allowed in generation clauses.

4) Adds tests to verify that generation clauses may not contain unstable system functions
like current_user (the functions listed in Appendix A of the functional spec). Tests don't
yet verify that you can't include current_role--to test that we need another test which runs
with authorization turned on.


Touches the following files:

M      java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java
M      java/engine/org/apache/derby/loc/messages.xml
M      java/shared/org/apache/derby/shared/common/reference/SQLState.java

Adds new error message which objects that generation clauses may not contain sql-issuing functions.


M      java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java
M      java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java

Wires in the prohibition in (1).


M      java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java

Adds new tests.


> 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
>            Assignee: Rick Hillegas
>         Attachments: derby-481-00-aa-prototype.diff, derby-481-01-aa-catalog.diff, derby-481-02-aa-utilities.diff,
derby-481-03-aa-grammar.diff, derby-481-04-aa-insert.diff, derby-481-05-aa-update.diff, derby-481-06-aa-genreferences.diff,
derby-481-07-aa-noSQLinRoutines.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.


Mime
View raw message