Hi,
Yes, that's weird. I found the problem now. The test case:
create table test(a int, b int);
select t.a, t.b t.c from test t;
The parser thinks the statement finishes at
select t.a, t.b t
and then doesn't find the column. I will try to fix the parser.
Thanks for reporting!
Regards,
Thomas
On Tuesday, October 1, 2013, Davide Cavestro wrote:
> Trying to execute an invalid INNER JOIN query that misses the comma
> before the declaration of the last field to be extracted, the engine
> complains
> Column "<1st column name>" not found;
> <http://localhost:8082/query.do?jsessionid=a88e857137898e83ce1e2c0fb3f00760#>
>
> I feel this is a minor issue: the SQL is really invalid, but *the error
> message is misleading*. That could become a problem for fairly complex
> queries, where one could waste time investigating on the wrong direction.
> Follows a reproducible test case.
>
> CREATE TABLE foo (ID int, FIELDX int);
> CREATE TABLE bar (ID int, FIELDY int);
>
> SELECT
> f.id,
> f.fieldx
> b.fieldy
> FROM foo f INNER JOIN bar b ON (f.id=b.id)
>
> (please note the missing comma before b.fieldy)
>
> This example produces the following error message using h2 v. 1.3.173
>
> Column "F.ID" not found; SQL statement:
> SELECT
> f.id,
> f.fieldx
> b.fieldy
> FROM foo f INNER JOIN bar b ON (f.id=b.id)
> [42122-170]<http://localhost:8082/query.do?jsessionid=a88e857137898e83ce1e2c0fb3f00760#>
> 42S22/42122
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:_e({},
> 'cvml', 'h2-database%[email protected]');>.
> To post to this group, send email to
> [email protected]<javascript:_e({}, 'cvml',
> '[email protected]');>
> .
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.