Derby
  1. Derby
  2. DERBY-4496

Column list size mismatch with ORDER BY in INSERT statement

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.6.1.0
    • Fix Version/s: 10.6.1.0
    • Component/s: SQL
    • Labels:
      None
    • Issue & fix info:
      Repro attached

      Description

      I see this error on trunk (revision 894516):

      ij> create table t(x varchar(100));
      0 rows inserted/updated/deleted
      ij> insert into t select * from (select * from sysibm.sysdummy1 order by length(ibmreqd)) t1;
      ERROR 42X32: The number of columns in the derived column list must match the number of columns in table 'T1'.

      The statement succeeds if I remove the ORDER BY clause:

      ij> insert into t select * from (select * from sysibm.sysdummy1) t1;
      1 row inserted/updated/deleted

      1. derby-4496.diff
        3 kB
        Dag H. Wanvik
      2. derby-4496.stat
        0.2 kB
        Dag H. Wanvik

        Activity

        Knut Anders Hatlen created issue -
        Hide
        Dag H. Wanvik added a comment -

        Attaching a fix for this issue. The issue was yet more occurences of the missing use of visibleSize instead of size on RCLs, now that we have ORDER BY in subqueries.
        The fix also adds the repro test case to OrderByInSubqueries.
        Running regressions.

        Show
        Dag H. Wanvik added a comment - Attaching a fix for this issue. The issue was yet more occurences of the missing use of visibleSize instead of size on RCLs, now that we have ORDER BY in subqueries. The fix also adds the repro test case to OrderByInSubqueries. Running regressions.
        Dag H. Wanvik made changes -
        Field Original Value New Value
        Attachment derby-4496.diff [ 12429437 ]
        Attachment derby-4496.stat [ 12429438 ]
        Dag H. Wanvik made changes -
        Issue & fix info [Repro attached] [Patch Available, Repro attached]
        Dag H. Wanvik made changes -
        Attachment derby-4496.diff [ 12429437 ]
        Dag H. Wanvik made changes -
        Attachment derby-4496.stat [ 12429438 ]
        Dag H. Wanvik made changes -
        Attachment derby-4496.diff [ 12429440 ]
        Attachment derby-4496.stat [ 12429441 ]
        Dag H. Wanvik made changes -
        Attachment derby-4496.diff [ 12429440 ]
        Dag H. Wanvik made changes -
        Attachment derby-4496.stat [ 12429441 ]
        Dag H. Wanvik made changes -
        Attachment derby-4496.stat [ 12429442 ]
        Attachment derby-4496.diff [ 12429443 ]
        Hide
        Knut Anders Hatlen added a comment -

        Thanks for picking this up, Dag. The patch looks fine to me. +1 to commit if the regression tests pass.

        Show
        Knut Anders Hatlen added a comment - Thanks for picking this up, Dag. The patch looks fine to me. +1 to commit if the regression tests pass.
        Hide
        Dag H. Wanvik added a comment -

        Regressions passed.

        Show
        Dag H. Wanvik added a comment - Regressions passed.
        Dag H. Wanvik made changes -
        Assignee Dag H. Wanvik [ dagw ]
        Hide
        Dag H. Wanvik added a comment -

        Committed fix as svn 896388, resolving.

        Show
        Dag H. Wanvik added a comment - Committed fix as svn 896388, resolving.
        Dag H. Wanvik made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Issue & fix info [Repro attached, Patch Available] [Repro attached]
        Fix Version/s 10.6.0.0 [ 12313727 ]
        Resolution Fixed [ 1 ]
        Hide
        Knut Anders Hatlen added a comment -

        Verified fix on trunk. Closing.

        Show
        Knut Anders Hatlen added a comment - Verified fix on trunk. Closing.
        Knut Anders Hatlen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gavin made changes -
        Workflow jira [ 12485699 ] Default workflow, editable Closed status [ 12800301 ]

          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