db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-6351) Syntax error on equal transition table name and correlation name in statement trigger
Date Tue, 24 Sep 2013 12:12:04 GMT

     [ https://issues.apache.org/jira/browse/DERBY-6351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Knut Anders Hatlen updated DERBY-6351:

    Attachment: d6351-1a.diff

d6351-1a.diff changes how the transformation code checks if a correlation name has been specified.
Instead of checking it indirectly, by seeing if the table name and the base table name are
equal, it now checks if getCorrelationName() returns null. This makes it handle the previously
failing case correctly.

The patch also adds a test case that verifies the fix.

All regression tests ran cleanly.
> Syntax error on equal transition table name and correlation name in statement trigger
> -------------------------------------------------------------------------------------
>                 Key: DERBY-6351
>                 URL: https://issues.apache.org/jira/browse/DERBY-6351
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:,,,,,,
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: d6351-1a.diff
> If a reference to a transition table in a statement trigger has a correlation name, and
that correlation name is equal to the name of the transition table, the CREATE TRIGGER statement
fails with a syntax error.
> To reproduce:
> {noformat}
> ij version 10.10
> ij> connect 'jdbc:derby:db;create=true';
> ij> create table t1(x int);
> 0 rows inserted/updated/deleted
> ij> create table t2(x int);
> 0 rows inserted/updated/deleted
> ij> create trigger tr1 after insert on t1 referencing new table as n insert into t2
select x from n as n;
> ERROR 42X01: Syntax error: Encountered "as" at line 1, column 89.
> Issue the 'help' command for general information on IJ command syntax.
> Any unrecognized commands are treated as potential SQL commands and executed directly.
> Consult your DBMS server reference documentation for details of the SQL syntax supported
by your server.
> {noformat}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message