Skip to content

TRUNK-6634: Liquibase changesets with dbms=mysql are silently skipped on MariaDB#6109

Open
jwnasambu wants to merge 1 commit into
openmrs:masterfrom
jwnasambu:TRUNK-6634
Open

TRUNK-6634: Liquibase changesets with dbms=mysql are silently skipped on MariaDB#6109
jwnasambu wants to merge 1 commit into
openmrs:masterfrom
jwnasambu:TRUNK-6634

Conversation

@jwnasambu
Copy link
Copy Markdown
Contributor

@jwnasambu jwnasambu commented May 19, 2026

Description of what I changed

I have addressed the issue where Liquibase changesets with dbms="mysql" are being silently skipped on MariaDB when using the MariaDB JDBC driver by creating a Liquibase database extension, OpenMRSMariaDBDatabase, which specifically targets MariaDB. This extension:

  1. Inherits from MariaDBDatabase maintaining all MariaDB specific behaviors and compatibility.
  2. Overrides getShortName() to return "mysql". This allows any changeset or modifySql tag marked with dbms="mysql" to correctly match and execute when
    running on MariaDB.
  3. Sets a higher priority than the default Liquibase MariaDBDatabase implementation to ensure it is picked up during database discovery.

Issue I worked on

see https://openmrs.atlassian.net/issues?filter=10641&selectedIssue=TRUNK-6634

Checklist: I completed these to help reviewers :)

  • My IDE is configured to follow the code style of this project.

    No? Unsure? -> configure your IDE, format the code and add the changes with git add . && git commit --amend

  • I have added tests to cover my changes. (If you refactored
    existing code that was well tested you do not have to add tests)

    No? -> write tests and add them to this commit git add . && git commit --amend

  • I ran mvn clean package right before creating this pull request and
    added all formatting changes to my commit.

    No? -> execute above command

  • All new and existing tests passed.

    No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.

  • My pull request is based on the latest changes of the master branch.

    No? Unsure? -> execute command git pull --rebase upstream master

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.44%. Comparing base (9490dcf) to head (5306487).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6109      +/-   ##
============================================
+ Coverage     59.27%   59.44%   +0.16%     
- Complexity     9235     9243       +8     
============================================
  Files           692      694       +2     
  Lines         37196    37257      +61     
  Branches       5476     5485       +9     
============================================
+ Hits          22048    22147      +99     
+ Misses        13167    13120      -47     
- Partials       1981     1990       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ibacher
Copy link
Copy Markdown
Member

ibacher commented May 19, 2026

So, I think this is generally a far-too-clever approach. The ticket here just asks us to make dbms=mysql into dbms=mysql,mariadb, which is easy, clean and safely backportable. Instead, this implementation swaps in a Liquibase plugin to continue to pretend that MariaDB is MySQL which:

  1. Introduces code we need to maintain and test
  2. Seems to ignore the fact that Liquibase is introducing this change because there are increasing divergences between MariaDB and MySQL in SQL syntax
  3. Is very hard to backport

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants