Re: Subqueries in LEFT JOIN throw syntax error (regression? similar to error from April, maybe the same error)

53 views
Skip to first unread message
Message has been deleted

Noel Grandin

unread,
Oct 17, 2012, 5:43:17 AM10/17/12
to h2-da...@googlegroups.com, Mariano Rodriguez Muro, Thomas Mueller
Hi

There are 2 problems here - the first is that you are not using the quoted form of the table name in your select statement.

The second problem is a bug in H2 - in the Parser class, in the readTableFilter method, we are calling isSelect(), which is incorrectly deciding that this is a UNION type clause.

Unfortunately, this is beyond my abilities to debug, maybe Thomas can figure it out.

Thomas, this is an improved test case:

CREATE TABLE tri (s varchar, p varchar, o varchar);

INSERT INTO tri VALUES ('x1', 'p', '1');
INSERT INTO tri VALUES ('x2', 's', '2');

SELECT *
FROM
   (SELECT * FROM tri) t1
    LEFT JOIN
    (  
       (SELECT * FROM tri) t2
        LEFT JOIN
        (SELECT * FROM tri) t3
        ON t3.p = 't'
    ) ON t2.p = 's'
WHERE
  t1.p = 'p'

Regards, Noel Grandin

Mariano Rodriguez Muro

unread,
Oct 23, 2012, 4:01:26 PM10/23/12
to h2-da...@googlegroups.com, Mariano Rodriguez Muro, Thomas Mueller
Hi Noel and Thomas, 

Is there any news on this bug? Do you think we can expect a fix in the next release?

I have the impression this could really be a regression since this Thomas fixed a very similar issue back
in April 30. I attach the link, maybe it can help [1]. 

Cheers,
Mariano

Reply all
Reply to author
Forward
0 new messages