Hi all!
We encountered a problem while deploying a Jmix app on a Mysql 8.4 database.
The problem is related to the liquibase changelog of the audit addon:
Caused by: liquibase.exception.DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MANUAL TINYINT(1) NULL, CONSTRAINT PK_AUDIT_LOGGED_ENTITY PRIMARY KEY (ID), UNIQ' at line 1 [Failed SQL: (1064) CREATE TABLE WLB.AUDIT_LOGGED_ENTITY (ID char(36) NOT NULL, CREATE_TS datetime NULL, CREATED_BY VARCHAR(255) NULL, NAME VARCHAR(100) NULL, AUTO TINYINT(1) NULL, MANUAL TINYINT(1) NULL, CONSTRAINT PK_AUDIT_LOGGED_ENTITY PRIMARY KEY (ID), UNIQUE (NAME))]
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:470) ~[liquibase-core-4.25.0.jar:na]
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:77) ~[liquibase-core-4.25.0.jar:na]
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:179) ~[liquibase-core-4.25.0.jar:na]
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1291) ~[liquibase-core-4.25.0.jar:na]
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1273) ~[liquibase-core-4.25.0.jar:na]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:755) ~[liquibase-core-4.25.0.jar:na]
... 58 common frames omitted
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MANUAL TINYINT(1) NULL, CONSTRAINT PK_AUDIT_LOGGED_ENTITY PRIMARY KEY (ID), UNIQ' at line 1
Follows my framework information:
Jmix version 2.3, 2.4
DBMS: Mysql ver 8.4.3
sh-5.1# mysql --version
mysql Ver 8.4.3 for Linux on aarch64 (MySQL Community Server - GPL)
sh-5.1#
As you can see here “MANUAL” is a reserved keyword for new MySql versions:
https://dev.mysql.com/doc/refman/8.4/en/keywords.html#keywords-8-4-detailed-M
We downgraded MySql to 8.0.x in order to let the app work, but I would like to know how we can handle these type of issues, and of course notify you about this topic!
Have a great day,
Ale