Skip to content

Add a new option to support MariaDB Server syntax - #1168

Merged
svetasmirnova merged 4 commits into
percona:3.xfrom
lefred:convert-to-mariadb
Sep 16, 2026
Merged

svetasmirnova merged 4 commits into
percona:3.xfrom
lefred:convert-to-mariadb

Conversation

@lefred

@lefred lefred commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

and allow user migration from MySQL to MariaDB
when using caching_sha2_password.

See https://lefred.be/content/dealing-with-caching_sha2_password-as-authentication-method-in-mariadb-server/

  • The contributed code is licensed under GPL v2.0
  • Contributor Licence Agreement (CLA) is signed
  • util/update-modules has been ran
  • Documentation updated
  • Test suite update

and allow user migration from MySQL to MariaDB
when using caching_sha2_password.

See https://lefred.be/content/dealing-with-caching_sha2_password-as-authentication-method-in-mariadb-server/

Signed-off-by: Frederic Descamps <lefred.descamps@gmail.com>
Copilot AI lite review requested due to automatic review settings September 4, 2026 09:29
@it-percona-cla

it-percona-cla commented Sep 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The emitted SQL for JSON_SET currently includes unnecessary backslashes in JSON paths (breaking the new test and potentially NO_BACKSLASH_ESCAPES environments).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new pt-show-grants option to convert MySQL CREATE USER / ALTER USER output into MariaDB-compatible syntax, including a special handling path for caching_sha2_password to support migrations.

Changes:

  • Add --convert-to-MariaDB and apply conversion when dumping from a MySQL server.
  • Implement convert_to_mariadb() to rewrite MySQL auth syntax and strip MySQL-8-only password-management clauses.
  • Add a dedicated unit test file covering rewriting behavior and warning paths, including caching_sha2_password.
File summaries
File Description
bin/pt-show-grants Implements --convert-to-MariaDB, adds convert_to_mariadb() and emits follow-up statements for caching_sha2_password.
t/pt-show-grants/convert_to_mariadb.t Adds unit tests for the MariaDB conversion logic, including warning behavior and the mysql.global_priv update path.
Review details
  • Files reviewed: 1/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

lefred and others added 2 commits September 4, 2026 13:01
…ich works

identically whether or not NO_BACKSLASH_ESCAPES is set

Signed-off-by: Frederic Descamps <lefred.descamps@gmail.com>
- Converted option to lowercase
- Added interactive test case

@EvgeniyPatlan EvgeniyPatlan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @lefred for your contribution

Comment thread t/pt-show-grants/convert_to_mariadb.t Outdated
Co-authored-by: EvgeniyPatlan <evgeniy.patlan@percona.com>
@svetasmirnova
svetasmirnova merged commit 6f0fba0 into percona:3.x Sep 16, 2026
5 checks passed
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.

5 participants