Skip to content

Fix MySQL compatibility: EscapeName backticks, REPLICATION REPLICA#9

Open
dnovitski wants to merge 1 commit into
masterfrom
fix/mysql-compat
Open

Fix MySQL compatibility: EscapeName backticks, REPLICATION REPLICA#9
dnovitski wants to merge 1 commit into
masterfrom
fix/mysql-compat

Conversation

@dnovitski

Copy link
Copy Markdown
Owner

Summary

Two MySQL compatibility fixes:

EscapeName backtick escaping

EscapeName() now doubles embedded backticks before wrapping. Previously, an identifier containing a backtick (e.g. a\b) would produce broken SQL: `a`b`instead of`a``b``.

MySQL 8.4 REPLICATION REPLICA privilege

The grant check now accepts both REPLICATION SLAVE and REPLICATION REPLICA. MySQL 8.4 renamed the privilege, so gh-ost would fail the privilege check on MySQL 8.4+ servers even when the user had the correct permissions.

- Escape embedded backticks in EscapeName by doubling them, preventing
  broken SQL identifiers (builder.go)
- Accept REPLICATION REPLICA privilege in grant check for MySQL 8.4+
  compatibility, where REPLICATION SLAVE was renamed (inspect.go)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant