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

NullPointerException for 'NOT EXISTS' with nested subquery

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.0.2.1, 10.1.3.1, 10.2.2.0, 10.3.2.1, 10.4.1.3
    • Fix Version/s: 10.3.3.0, 10.4.1.3
    • Component/s: SQL
    • Labels:
      None
    • Environment:
      Committed revision 651700 to 10.3

      Description

      Queries with 'not exists' followed by a nested subquery results in NPE:

      ----------8<-------------
      connect 'jdbc:derby:testdb;create=true';
      create table a (aa int, bb int);
      – 0 rows inserted/updated/deleted

      create table b (bb int);
      – 0 rows inserted/updated/deleted

      insert into a values (1, 1), (1, 2), (2, 2);
      – 3 rows inserted/updated/deleted

      insert into b values (1);
      – 1 row inserted/updated/deleted

      select * from a
      where not exists
      (select bb from b where a.bb=b.bb);

      – AA |BB
      – ----------------------
      – 1 |2
      – 2 |2

      select bb from (select bb from b) p;
      – BB
      – -----------
      – 1

      select * from a
      where not exists
      (select bb from (select bb from b) p where a.bb=p.bb);
      – ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
      ----------->8---------------

        Attachments

        1. derby.log
          3 kB
          Jorgen Loland
        2. d3321.stat
          0.2 kB
          Thomas Nielsen
        3. d3321.diff
          3 kB
          Thomas Nielsen

          Issue Links

            Activity

              People

              • Assignee:
                thomanie Thomas Nielsen
                Reporter:
                jorgenlo Jorgen Loland
              • Votes:
                1 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: