Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6357

CREATE TRIGGER doesn't detect all illegal references to SESSION schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.10.1.1
    • 10.10.2.0, 10.11.1.1
    • SQL
    • None
    • Normal
    • Repro attached

    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

        1. d6357-1a.diff
          4 kB
          Knut Anders Hatlen

        Issue Links

          Activity

            People

              knutanders Knut Anders Hatlen
              knutanders Knut Anders Hatlen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: