IncrementBy does not work for MySQL in Liquibase 4.17

Hi. We just migrated to Liquibase 4.17 (for the parallel updating).
When we try to run a script with an addAutoIncrement on a MySQL table, we get the following error:

 2022-10-21 09:45:36,293 ERROR - [petere]: Validation Failed:
     2 changes have validation failures
          incrementBy is not allowed on mysql, wokpdatabase-201907042004-COM1854.xml::COM-1854-001::rudie
          incrementBy is not allowed on mysql, wokpdatabase-201907042004-COM1854.xml::COM-1854-002::rudie
 [http-thread-pool::https-listener(5)] nl.tent.database.command.LiquibaseCommand.execute(39)
liquibase.exception.ValidationFailedException: Validation Failed:

I read somewhere that this issue was fixed in version 4.11 (Fixed autoIncrement incrementBy/startWith support in MySQL, H2, HSQLDB, and MariaDB by tozogabee · Pull Request #3026 · liquibase/liquibase · GitHub).
Is there a fix or a workaround?

Mysql and MariaDB don’t support incrementBy in a way how other platforms do. They have auto_increment_offset var set globally or per session, but not for particular table.

We’ve solved the problem by replacing the <addAutoIncrement> by sql-statements:
<addAutoIncrement tableName=“Actief” columnName=“id” columnDataType=“BIGINT” incrementBy=“1” startWith=“1”/>

    <sql>ALTER TABLE Actief MODIFY id BIGINT AUTO_INCREMENT</sql>
    <sql>ALTER TABLE Actief AUTO_INCREMENT=1</sql>
1 Like