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

Update trigger defined on one column fires on update of other columns

    XMLWordPrintableJSON

Details

    • Normal
    • Release Note Needed, Repro attached
    • Regression, Wrong query result

    Description

      I see this problem on 10.8 and higher. To reproduce, create a database with a trigger like this:

      connect 'jdbc:derby:trigdb;create=true';
      create table t1(x int, y int);
      create table t2(x int, y int);
      create trigger tr after update of x on t1 referencing old table as old insert into t2 select * from old;

      Then run dblook on the database, and you'll see the following output:

      – ----------------------------------------------
      – DDL Statements for triggers
      – ----------------------------------------------

      CREATE TRIGGER "APP"."TR" AFTER UPDATE OF "X", "Y" ON "APP"."T1" REFERENCING OLD_TABLE AS OLD FOR EACH STATEMENT insert into t2 select * from old;

      Notice that the DDL creates an update trigger for columns X and Y, whereas the original trigger was defined on column X only.

      I see the expected DDL on 10.7.1.1.

      Attachments

        1. releaseNote.html
          5 kB
          Myrna van Lunteren
        2. DERBY6383_patch3_diff.txt
          8 kB
          Mamta A. Satoor
        3. releaseNote.html
          5 kB
          Mamta A. Satoor
        4. releaseNote.html
          4 kB
          Mamta A. Satoor
        5. derby_for_Embedded_40Changes10_7testTriggers.log
          169 kB
          Mamta A. Satoor
        6. derby_for_Embedded_40Changes10_9testDisposableStatisticsExplicit.log
          190 kB
          Mamta A. Satoor
        7. error-stacktrace_for_Embedded_40Changes10_9testDisposableStatisticsExplicit.out
          67 kB
          Mamta A. Satoor
        8. error-stacktrace_for_Embedded_40Changes10_7testTriggers.out
          56 kB
          Mamta A. Satoor
        9. runall.out
          455 kB
          Mamta A. Satoor
        10. DERBY6383_patch2_diff.txt
          12 kB
          Mamta A. Satoor
        11. DERBY6383_patch1_diff.txt
          1 kB
          Mamta A. Satoor
        12. d6383.sql
          0.4 kB
          Knut Anders Hatlen

        Issue Links

          Activity

            People

              mamtas Mamta A. Satoor
              knutanders Knut Anders Hatlen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: