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

NPE on a query with having clause involving a join

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.4.2.0
    • Fix Version/s: 10.3.3.1, 10.4.2.1, 10.5.1.1
    • Component/s: SQL
    • Labels:
      None
    • Environment:
      Windows 2003 Server
    • Issue & fix info:
      High Value Fix
    • Bug behavior facts:
      Regression

      Description

      A simple query involving a join and having clause causes a NPE. Any subsequent executions cause severe errors. It almost looks like the underlying connection was closed out.

      ====

      C:\apps\derby\db-derby-10.4.2.0-bin\db-derby-10.4.2.0-bin\bin>ij
      ij version 10.4
      ij> connect 'jdbc:derby://speed:1527/ClassicModels;user=sa;password=sa
      ';
      ij> create table t1(i int, c varchar(20));
      0 rows inserted/updated/deleted
      ij> create table t2(i int, c2 varchar(20), i2 int);
      0 rows inserted/updated/deleted
      ij> insert into t1 values(1, 'abc');
      1 row inserted/updated/deleted
      ij> insert into t1 values(2, 'abc');
      1 row inserted/updated/deleted
      ij> insert into t2 values(1, 'xyz', 10);
      1 row inserted/updated/deleted
      ij> insert into t2 values(1, 'aaa', 20);
      1 row inserted/updated/deleted
      ij> insert into t2 values(2, 'xxx', 30);
      1 row inserted/updated/deleted
      ij> select t1.i, avg(t2.i2) from t1 inner join t2 on (t1.i = t2.i) group by t1.i
      having avg(t2.i2) > 0;
      ERROR XJ001: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC: java.lang.
      NullPointerException¶¶XJ001.U

        Attachments

        1. AggregateExpressionResultColumn.txt
          0.8 kB
          Katherine Marsden
        2. querytree_fail.txt
          4 kB
          Katherine Marsden
        3. querytree_works.txt
          4 kB
          Katherine Marsden

          Issue Links

            Activity

              People

              • Assignee:
                army A B
                Reporter:
                viyer Venkateswaran Iyer
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: