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.stat
        0.2 kB
        Dag H. Wanvik
      2. derby-4496.diff
        3 kB
        Dag H. Wanvik

        Activity

        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.
        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.
        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.
        Hide
        Knut Anders Hatlen added a comment -

        Verified fix on trunk. Closing.

        Show
        Knut Anders Hatlen added a comment - Verified fix on trunk. Closing.

          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