jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
693 stars 124 forks source link

Error creating UUID from database value when trying log in application (mariaDB) #3888

Open rusiaikinat opened 3 days ago

rusiaikinat commented 3 days ago

Environment

Jmix version: 2.4.0

Steps To Reproduce

  1. Create a new project
  2. Configure MariaDB datastore
  3. Run the application
  4. Try to login

Current Behavior

https://github.com/jmix-framework/jmix/issues/70#issuecomment-2483085690 - MySQL (irrelevant, see https://github.com/jmix-framework/jmix/issues/3888#issuecomment-2485168443)

https://github.com/jmix-framework/jmix/issues/70#issuecomment-2484792614 - MariaDB

Workaround

Downgrade Liquibase version to 4.25

implementation 'org.liquibase:liquibase-core:4.25.0!!'

Cause

Spring 3.3.5 depends on liquibase 4.27.

Since liquibase 4.27 (for MariaDB 10.10.6+) and liquibase 4.27 (for MariaDB 10.7+) specifying uuid type in changelog.xml leads to generation of another column type: uuid instead of char(36).

At the same time the behaviour did not changed for MySQL: uuid in changelog.xml generates char(36) column.

This change is incompatible with io.jmix.eclipselink.impl.dbms.String32UuidConverter which selected for MySQL and MariaDB in io.jmix.eclipselink.impl.dbms.JmixMySQLPlatform#getUuidConverter.

Task

Considering that Liquibase now generates UUID columns for MariaDB and MySQL in different ways, we need to add support for MariaDBPlatform and process UUID columns accordingly or generate another column type as for Oracle.

Gavrilov-Ivan commented 3 days ago

It's relevant for MariaDB only. It works fine with MySQL if extra changelog is not applied (https://youtrack.haulmont.com/issue/JST-5462/Generation-of-changeLog-before-startup)