#1293 NullPointerException

current-release
closed-fixed
Fred Toussi
1
2013-08-14
2013-03-29
Ruslan Vaskov
No

Example below is pretty senseless, but I cut off all insignificant data and expressions to ease debugging.

CREATE TABLE Table_1 (Col int)
CREATE TABLE Table_2 (Col int)
INSERT INTO Table_1 VALUES (1)
INSERT INTO Table_2 VALUES (1)

SELECT * FROM Table_1
WHERE EXISTS
( SELECT * FROM
(SELECT Col FROM Table_2) AS o
JOIN
(SELECT Col FROM Table_1) AS t
ON o.Col=t.Col
WHERE Table_1.Col=t.Col)

Discussion

  • Fred Toussi
    Fred Toussi
    2013-05-31

    This has been fixed in snapshots for 2.3.0

     
  • Fred Toussi
    Fred Toussi
    2013-05-31

    • assigned_to: nobody --> fredt
    • priority: 5 --> 1
    • status: open --> closed
     
  • Fred Toussi
    Fred Toussi
    2013-05-31

    • status: closed --> closed-fixed
     
  • Fred Toussi
    Fred Toussi
    2013-07-17

    • status: closed-fixed --> open-accepted
     
  • Fred Toussi
    Fred Toussi
    2013-07-17

    Was marked Fixed by mistake. Will be fixed for the next snapshot.

    Workaround involves adding a reference to Table_1 to the inner SELECT which is referenced by the WHERE condition. You can move the WHERE condition or duplicate it in the inner SELECT, or add any condition that references Table_1.

    In this example, the condition is duplicated:

    SELECT * FROM Table_1
    WHERE EXISTS
    ( SELECT * FROM
    (SELECT Col FROM Table_2) AS o
    JOIN
    (SELECT Col FROM Table_1 t1
    WHERE Table_1.Col=t1.Col) AS t
    ON o.Col=t.Col
    WHERE Table_1.Col=t.Col)

     
  • Fred Toussi
    Fred Toussi
    2013-08-14

    Fixed and committed to SVN.

     
  • Fred Toussi
    Fred Toussi
    2013-08-14

    • milestone: --> current-release
    • labels: --> engine 2.0
    • status: open-accepted --> closed-fixed