H2 database regression 1.9.5 -> 2.0-rc5

I moved a bunch of changelog files and associated machinery to 2.0-rc5.  Oddly, my unit tests began failing.  I turned the H2 trace level up, and saw that–this is my best guess–Liquibase’s H2 database implementation is trying to be nice about keywords.  I had a column named “value” in one of my tables.  H2 is reporting that Liquibase is issuing the command:

CREATE TABLE NameType (code VARCHAR(30) NOT NULL, “value” VARCHAR(100), CONSTRAINT PK_NAMETYPE PRIMARY KEY (code))

Note the quotes around value, which is a keyword in H2.  This quoting, which I THINK is new, has the other effect of case-sensitizing the column.  Consequently, an insert statement, later on down the line, produced by Hibernate, fails, because the VALUE column cannot be found.

This is, I guess, my fault (for unwittingly using a keyword as a column name), but offhand I’m not sure how to either (a) tell Liquibase to stop being helpful or (b) quote ALL my identifiers in my changelog.  Should I, for example, declare it like this:

column name="“value”"

…in my column tag?

Thanks,
Laird

You shouldn’t have to quote your column name, they should be always quotes.  Insert should be using the escape value function as well, looking at the code it should.  I’ll look into why it is not. 

H2Database was changed (improved) since 1.9 to quote a select number of words, including VALUE.  With 2.0, you can add a new class that extends from liquibase.database.core.H2Datatabase and overrides the escapeDatabaseObject() method.  As long as you put it in a liquibase.ext package and also override getPriority() to return a number higher than 5, your class will be used instead.

Nathan

Originally posted by: Nathan
You shouldn't have to quote your column name, they should be always quotes.

I know this is now an old thread, but I wanted to add some more data points here.

First, on H2, at least, identifiers are not quoted by default.  Only reserved keywords seem to be.
Next, if I declare my “value” column as “VALUE” (case change only), everything works fine and it is not quoted.

Best,
Laird