[HSQLDB] Unnecessary quoting of column name?

I have a situation with hsqldb that is giving me some problems. For this changelog:

                                                                                               

I am getting a SQL statement generated like this:

– Changeset classpath:migrations/changelog.xml::createUsernamePasswordsTable::evan::(Checksum: 2:a9e5b31be82c449c720781a980039eeb)
CREATE TABLE username_passwords (id INT GENERATED BY DEFAULT AS IDENTITY  NOT NULL, person_id INT, username VARCHAR(255), “password” VARCHAR(255), CONSTRAINT PK_USERNAME_PASSWORDS PRIMARY KEY (id));

Notice the quotations around “password”??  This causes hsqldb to use case-sensitive comparisons for that column name.  The issue comes later then, when my jdbc preparedStatement uppercases the column name and then goes looking for the column PASSWORD in the database, which of course, hsqldb says does not exist.

So the question is, why is liquibase putting quotes around that one column name? And, how do I get it to stop doing so?

Thanks!
Evan

Okay, so I poked around a bit and found the keywords list in the class liquibase.database.core.HsqlDatabase, and “password” is in the list, making it a candidate to be quoted. This would be fine if password is a reserved word in sql.

According to these sources it is not a reserved word:
https://sourceforge.net/projects/hsqldb/forums/forum/73674/topic/3850211 (See comment #4)
http://developer.mimer.com/validator/sql-reserved-words.tml
http://www.pacosdrivers.com/asp/reserved/
http://www.contrib.andrew.cmu.edu/~shadow/sql/sql2bnf.aug92.txt
http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt

It looks to me like “password” should be removed from the keywords list in HsqlDatabase.java

Evan

I opened an issue for this here:
http://liquibase.jira.com/browse/CORE-710

Thanks for pointing that out.  I’m not sure where the list of reserved words came from originally, but I removed password from the list for the next release.  For now, you could capitalize password in your changelog or use the tag which will not do any quoting.

Nathan

It’s really old topic, but HSQLDB doc says:


<span class="Apple-style-span"