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

NPE in left join whose inner table has a generated column

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.5.1.1
    • Fix Version/s: 10.10.2.0, 10.11.1.1
    • Component/s: SQL
    • Labels:
      None
    • Urgency:
      Normal
    • Issue & fix info:
      Repro attached

      Description

      Derby trips over an NPE while processing a left join whose inner table has a generated column. The NPE is not printed to derby.log, indicating another problem. The bug goes as far back as 10.5.1.1, the release which introduced generated columns. The NPE does NOT crash the connection. The application can continue issuing statements on the connection.

      The following script shows this problem:

      connect 'jdbc:derby:memory:db;create=true';

      create table t1( c1 int, c2 int generated always as ( -c1 ) );
      create table t2( c1 int );

      insert into t1( c1 ) values ( 2 ), ( 20 );
      insert into t2( c1 ) values ( 2 ), ( 200 );

      – raises a SQLException wrapping an NPE
      select * from t2 left join t1 on t1.c1 = t2.c1;

        Attachments

        1. derby-6346-01-aa-logJavaException.diff
          0.7 kB
          Richard N. Hillegas
        2. derby-6346-02-aa-generateNullForLeftJoins.diff
          3 kB
          Richard N. Hillegas

          Activity

            People

            • Assignee:
              rhillegas Richard N. Hillegas
              Reporter:
              rhillegas Richard N. Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: