Liquibase creates table "user" in lower case for H2 database #2701
Labels
autocandidate
casing
DBH2
IntegrationSpringboot
RiskHigh
Items that require more extensive testing, change an existing API, or add new features.
sprint2022-30
TypeDataType
TypeIncorrectSQL
ver4.7.0
Projects
Environment
Liquibase Version: 4.7.0
Liquibase Integration & Version: spring-boot 2.6.3
Liquibase Extension(s) & Version: -
Database Vendor & Version: H2 1.4.200
Operating System Type & Version: -
Description
Since liquibase version 4.7.0 my spring-boot integration tests fail for a table named "user" with the following exception:
org.h2.jdbc.JdbcSQLSyntaxErrorException: table "USER" not found
.The changelog file uses tableName="user" in the createTable section for creating this table.
I checked the generated SQL-statement for this table which looks like this:
CREATE CACHED TABLE "PUBLIC"."user" (...)
In version 4.6.2 the tests still worked. The generated SQL-statement in this version looked like this:
CREATE CACHED TABLE "PUBLIC"."USER" (...)
So apparently the table name changed to lower-case in the SQL-statement.
However, the "user" table is the only table which is created in lower-case after the version update. All other tables are also defined in lower-case in the changelog, but the generated SQL is still in upper-case.
I noticed you changed the H2 version with 4.7.0 (#2285) which added some new H2 keywords, including "user". It seems there is some sort of special treatment for this case.
I found a workaround for this issue by explicitly using an upper-case name in the createTable section of the changelog. Still I think it's confusing that only this table uses lower case.
Steps To Reproduce
List the steps to reproduce the behavior.
Actual Behavior
A clear and concise description of what happens in the software with the version used.
org.h2.jdbc.JdbcSQLSyntaxErrorException: table "USER" not found
exception is thrownExpected/Desired Behavior
A clear and concise description of what happens in the software after a fix is created and merged.
The text was updated successfully, but these errors were encountered: