Column not found when column is quoted

652 views
Skip to first unread message

Lukas Eder

unread,
Sep 22, 2014, 1:12:55 PM9/22/14
to h2-da...@googlegroups.com
Hello folks,

I've just analysed this jOOQ support request on Stack Overflow here and suspect that it is really a bug in H2:

This query works in H2:

select 1 abc, count(*) from dual group by abc order by abc asc

So does this one:

select 1 "ABC", count(*) from dual group by "ABC" order by "ABC" asc

but this one doesn't:

select 1 "abc", count(*) from dual group by "abc" order by "abc" asc

I'm getting this exception:

org.jooq.exception.DataAccessException: SQL [select 1 "abc", count(*) from dual group by "abc" order by "abc" asc]; Feld "abc" nicht gefunden
Column "abc" not found; SQL statement:
select 1 "abc", count(*) from dual group by "abc" order by "abc" asc [42122-177]

I suspect that quotes are not properly evaluated in GROUP BY clauses, at least when they surround an alias declared in the SELECT clause.

Cheers,
Lukas

Thomas Mueller

unread,
Sep 22, 2014, 2:40:22 PM9/22/14
to h2-da...@googlegroups.com
Hi, 

You are right, this is a bug. I will try to fix it. 

Regards, 
Thomas 
--
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 h2-database...@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Lukas Eder

unread,
Sep 23, 2014, 3:17:48 AM9/23/14
to h2-da...@googlegroups.com
Thank you very much, Thomas!


Am Montag, 22. September 2014 20:40:22 UTC+2 schrieb Thomas Mueller:
Hi, 

You are right, this is a bug. I will try to fix it. 

Regards, 
Thomas 

On Monday, September 22, 2014, Lukas Eder <lukas...@gmail.com> wrote:
Hello folks,

I've just analysed this jOOQ support request on Stack Overflow here and suspect that it is really a bug in H2:

This query works in H2:

select 1 abc, count(*) from dual group by abc order by abc asc

So does this one:

select 1 "ABC", count(*) from dual group by "ABC" order by "ABC" asc

but this one doesn't:

select 1 "abc", count(*) from dual group by "abc" order by "abc" asc

I'm getting this exception:

org.jooq.exception.DataAccessException: SQL [select 1 "abc", count(*) from dual group by "abc" order by "abc" asc]; Feld "abc" nicht gefunden
Column "abc" not found; SQL statement:
select 1 "abc", count(*) from dual group by "abc" order by "abc" asc [42122-177]

I suspect that quotes are not properly evaluated in GROUP BY clauses, at least when they surround an alias declared in the SELECT clause.

Cheers,
Lukas

--
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 h2-database+unsubscribe@googlegroups.com.

thilo...@googlemail.com

unread,
Oct 22, 2014, 10:46:23 PM10/22/14
to h2-da...@googlegroups.com
This seems to be the same problem as in our Issue 578

http://code.google.com/p/h2database/issues/detail?id=578&sort=-id

Thomas Mueller

unread,
Dec 19, 2014, 3:46:19 AM12/19/14
to H2 Google Group
Hi,

This should be fixed in version 1.4.184.

Regards,
Thomas


On Thu, Oct 23, 2014 at 4:46 AM, <thilo...@googlemail.com> wrote:
This seems to be the same problem as in our Issue 578

http://code.google.com/p/h2database/issues/detail?id=578&sort=-id

--
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 h2-database...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages