You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2013/09/30 16:36:24 UTC
[jira] [Updated] (DERBY-6357) CREATE TRIGGER doesn't detect all
illegal references to SESSION schema
[ https://issues.apache.org/jira/browse/DERBY-6357?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Knut Anders Hatlen updated DERBY-6357:
--------------------------------------
Attachment: d6357-1a.diff
The attached patch, d6357-1a.diff, adds more overrides of QueryTreeNode.referencesSessionSchema() so that it detects references in VALUES statements and sub-queries.
All regression tests passed with the patch.
> CREATE TRIGGER doesn't detect all illegal references to SESSION schema
> ----------------------------------------------------------------------
>
> Key: DERBY-6357
> URL: https://issues.apache.org/jira/browse/DERBY-6357
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.10.1.1
> Reporter: Knut Anders Hatlen
> Assignee: Knut Anders Hatlen
> Attachments: d6357-1a.diff
>
>
> The reference manual's section on the DECLARE GLOBAL TEMPORARY TABLE statement says: Temporary tables cannot be referenced in a triggered-SQL-statement
> It detects most cases and reports:
> ERROR XCL51: The requested function can not reference tables in SESSION schema.
> However, some references are not detected if they are in a subquery. For example:
> ij version 10.10
> ij> connect 'jdbc:derby:memory:db;create=true';
> ij> declare global temporary table temptable(x int) not logged;
> 0 rows inserted/updated/deleted
> ij> create table t1(x int);
> 0 rows inserted/updated/deleted
> ij> create table t2(b boolean);
> 0 rows inserted/updated/deleted
> ij> create trigger tr1 after insert on t1 insert into t2 values exists(select * from session.temptable);
> 0 rows inserted/updated/deleted
> This CREATE TRIGGER statement should have raised an error.
--
This message was sent by Atlassian JIRA
(v6.1#6144)