Derby
  1. Derby
  2. DERBY-4451

ArrayIndexOutOfBoundsException or ASSERT FAILED when inserting generated columns out of order

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.5.3.0, 10.6.1.0
    • Fix Version/s: 10.5.3.1, 10.6.1.0
    • Component/s: SQL
    • Labels:
      None

      Description

      I see this error when I specify the columns in a different order than in the table definition. It only fails if a multi-row table constructor is used.

      ij> create table t(a int, b generated always as (-a));
      0 rows inserted/updated/deleted
      ij> insert into t(b,a) values (default,1);
      1 row inserted/updated/deleted
      ij> insert into t(b,a) values (default,1), (default, 2);
      ERROR XJ001: Java exception: '1 >= 1: java.lang.ArrayIndexOutOfBoundsException'.

      And in a sane build:

      ij> insert into t(b,a) values (default,1),(default,2);
      ERROR XJ001: Java exception: 'ASSERT FAILED More columns in result column list than in base table: org.apache.derby.shared.common.sanity.AssertFailure'.

      This bug may be similar to DERBY-4448, but the stack trace is different, and DERBY-4448 does not raise an ASSERT FAILED in sane builds.

      1. derby-4451.diff
        11 kB
        Dag H. Wanvik
      2. derby-4451.stat
        0.4 kB
        Dag H. Wanvik
      3. derby-4451b.diff
        11 kB
        Dag H. Wanvik
      4. derby-4451b.stat
        0.4 kB
        Dag H. Wanvik
      5. derby-4451c.diff
        17 kB
        Dag H. Wanvik
      6. derby-4451c.stat
        0.5 kB
        Dag H. Wanvik
      7. derby-4451d.diff
        12 kB
        Dag H. Wanvik
      8. derby-4451d.stat
        0.3 kB
        Dag H. Wanvik

        Activity

        Knut Anders Hatlen created issue -
        Dag H. Wanvik made changes -
        Field Original Value New Value
        Attachment derby-4451.diff [ 12425745 ]
        Attachment derby-4451.stat [ 12425746 ]
        Dag H. Wanvik made changes -
        Issue & fix info [Patch Available]
        Dag H. Wanvik made changes -
        Assignee Dag H. Wanvik [ dagw ]
        Dag H. Wanvik made changes -
        Attachment derby-4451b.diff [ 12425786 ]
        Attachment derby-4451b.stat [ 12425787 ]
        Dag H. Wanvik made changes -
        Attachment derby-4451b.diff [ 12425786 ]
        Dag H. Wanvik made changes -
        Attachment derby-4451b.diff [ 12425788 ]
        Dag H. Wanvik made changes -
        Attachment derby-4451c.diff [ 12425923 ]
        Attachment derby-4451c.stat [ 12425924 ]
        Dag H. Wanvik made changes -
        Attachment derby-4451d.diff [ 12425981 ]
        Attachment derby-4451d.stat [ 12425982 ]
        Dag H. Wanvik made changes -
        Attachment derby-4451d.diff [ 12425981 ]
        Dag H. Wanvik made changes -
        Attachment derby-4451d.stat [ 12425982 ]
        Dag H. Wanvik made changes -
        Attachment derby-4451d.diff [ 12425989 ]
        Attachment derby-4451d.stat [ 12425990 ]
        Dag H. Wanvik made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Issue & fix info [Patch Available]
        Fix Version/s 10.6.0.0 [ 12313727 ]
        Resolution Fixed [ 1 ]
        Dag H. Wanvik made changes -
        Fix Version/s 10.5.3.1 [ 12314182 ]
        Fix Version/s 10.5.4.0 [ 12314154 ]
        Knut Anders Hatlen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Knut Anders Hatlen made changes -
        Fix Version/s 10.5.4.0 [ 12314154 ]
        Gavin made changes -
        Workflow jira [ 12482509 ] Default workflow, editable Closed status [ 12800837 ]

          People

          • Assignee:
            Dag H. Wanvik
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development