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

Wrong value returned in a row trigger action statement if the table has column names that are identical when upper-cased.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6
    • 10.2.1.6
    • SQL
    • None

    Description

      If the triggered table has columns I and "i" then any reference to these columns in the action statement for the old or new row will return the value for the first column in the table .with the matching name in upper-case.

      > ij> create table tsn (I integer, "i" integer);
      > 0 rows inserted/updated/deleted
      > ij> create table tsn_t (a integer, b integer);
      > 0 rows inserted/updated/deleted
      > ij> create trigger tr_sn after insert on tsn
      > referencing new as n
      > for each row mode db2sql
      > insert into tsn_t(a, b) values (n.I, n."i");
      > 0 rows inserted/updated/deleted
      > ij> insert into tsn values (1, 234);
      > 1 row inserted/updated/deleted
      > ij> select * from tsn;
      > I |i
      > -----------------------
      > 1 |234
      > ij> select * from tsn_t;
      > A |B
      > -----------------------
      > 1 |1

      See http://wiki.apache.org/db-derby/TriggerImplementation

      Test case above will be added to triggerGeneral.sql commented with this bug number.

      Attachments

        Activity

          People

            djd Daniel John Debrunner
            djd Daniel John Debrunner
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: