Vaibhav95g / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

SQL Grammar error, if IN clause with single argument is not enclosed with Brackets. #586

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a table with a single column.

CREATE TABLE IF NOT EXISTS dummytbl
(dummycol VARCHAR2(255 CHAR));

2. A simple query execution:> select * from dummytbl where dummycol IN '1234' 
<<< fails
3. Whereas converging the IN clause argrument brackets, the issue is gone.> 
select * from dummytbl where dummycol IN ('1234') <<< success

Expected : The query in step-2 should have run successfully, in case its just 
one argument in IN clause.

Actual : Query fails with a SQL grammar exception (trace attached)

SQL Grammar

Original issue reported on code.google.com by himanshu...@gmail.com on 26 Sep 2014 at 9:19

Attachments:

GoogleCodeExporter commented 9 years ago
Before logging a bug, please check if there is a database where it actually 
works.

Original comment by thomas.t...@gmail.com on 26 Sep 2014 at 10:12

GoogleCodeExporter commented 9 years ago
Works perfectly fine in Oracle 11g

Original comment by himanshu...@gmail.com on 26 Sep 2014 at 10:34

GoogleCodeExporter commented 9 years ago
OK, you are right. But it doesn't work in any other database I have tested, and 
I don't plan to add this Oracle compatibility feature. Sorry.

Original comment by thomas.t...@gmail.com on 26 Sep 2014 at 12:57