akarshan2701 / h2database

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

Creating a column named "UNIQUE" fails when reopening the database #68

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Execute: create table MyTable ("UNIQUE" boolean)
2. Close the database.
3. Try reopening the database. You get the following error :

An error occurred while establishing the connection:
   Type: org.h2.jdbc.JdbcSQLException   Error Code: 42001   SQL State: 42001
Message:
   Syntax error in SQL statement CREATE CACHED TABLE PUBLIC.MYTABLE(
    UNIQUE BOOLEAN
); expected (; SQL statement:
CREATE CACHED TABLE PUBLIC.MYTABLE(
    UNIQUE BOOLEAN
) [42001-79]

If you create the table using lowercases it works : create table MyTable 
("unique" boolean).

It appears that quotes are lost when the table is created. When looking at 
table SQL stored in INFORMATION_SCHEMA.TABLES the quotes 
are missing for uppercases and preserved for lowercases (in fact if it's 
different from "UNIQUE", "UNIQUe" works for example).

What version of the product are you using? On what operating system, file 
system, and virtual machine?
H2 1.0.79, Windows XP/Vista, NTFS, JDK 1.5.0_14 / JDK 1.6.0_12

Do you know a workaround?

Yes, use lowercases for this column name.

How important/urgent is the problem for you?

There's a workaround, not so urgent.

In your view, is this a defect or a feature request?

Defect.

Original issue reported on code.google.com by cdemoust...@gmail.com on 5 Mar 2009 at 4:09

GoogleCodeExporter commented 8 years ago
I found the problem. This will be fixed in the next release.

Original comment by thomas.t...@gmail.com on 8 Mar 2009 at 12:02

GoogleCodeExporter commented 8 years ago
Fixed in version 1.1.109

Original comment by thomas.t...@gmail.com on 14 Mar 2009 at 11:17