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.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6
    • Fix Version/s: 10.2.1.6
    • Component/s: SQL
    • Labels:
      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.

        Activity

        Gavin made changes -
        Workflow jira [ 12361669 ] Default workflow, editable Closed status [ 12797537 ]
        Daniel John Debrunner made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Daniel John Debrunner made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 10.2.0.0 [ 11187 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Daniel John Debrunner added a comment -

        Fixed & tested.

        Show
        Daniel John Debrunner added a comment - Fixed & tested.
        Daniel John Debrunner made changes -
        Field Original Value New Value
        Assignee Daniel John Debrunner [ djd ]
        Daniel John Debrunner created issue -

          People

          • Assignee:
            Daniel John Debrunner
            Reporter:
            Daniel John Debrunner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development