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-6540) Schema-qualified table names could be mistaken for transition tables
Date Wed, 09 Apr 2014 12:32:14 GMT

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

Knut Anders Hatlen updated DERBY-6540:
--------------------------------------

    Attachment: d6540-1a.diff

The attached patch (d6540-1a.diff) fixes the bug by checking if the TableName node has a schema
before determining if it refers to a transition table or transition variable. Since transition
tables/variables cannot have schema name, it cannot be one if it has a schema. The patch also
adds a regression test case.

All the regression tests ran cleanly with the patch.

> Schema-qualified table names could be mistaken for transition tables
> --------------------------------------------------------------------
>
>                 Key: DERBY-6540
>                 URL: https://issues.apache.org/jira/browse/DERBY-6540
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.11.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: d6540-1a.diff
>
>
> ij version 10.11
> ij> connect 'jdbc:derby:memory:db;create=true';
> ij> create table new(x int);
> 0 rows inserted/updated/deleted
> ij> create table t(y int);
> 0 rows inserted/updated/deleted
> ij> create trigger tr1 after insert on t referencing new table as new select x from
app.new;
> ERROR 42X04: Column 'X' is either not in any table in the FROM list or appears within
a join specification and is outside the scope of the join specification or appears in a HAVING
clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then
'X' is not a column in the target table.
> The error message here is wrong. Column X does exist in APP.NEW, so the CREATE TRIGGER
statement should have succeeded.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message