Details
Description
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.
Attachments
Attachments
Issue Links
- is related to
-
DERBY-6705 Triggers should not allow MERGE statements that reference temporary tables
- Closed
- relates to
-
DERBY-534 Support use of the WHEN clause in CREATE TRIGGER statements
- Closed