Add a new option to support MariaDB Server syntax - #1168
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
🟡 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-MariaDBand 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.
…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
svetasmirnova
approved these changes
Sep 16, 2026
EvgeniyPatlan
approved these changes
Sep 16, 2026
EvgeniyPatlan
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Thanks @lefred for your contribution
Co-authored-by: EvgeniyPatlan <evgeniy.patlan@percona.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/