Skip to content

Fix exporting privileges of a MariaDB role - #20562

Open
xmaks82 wants to merge 1 commit into
phpmyadmin:masterfrom
xmaks82:export-mariadb-role-grants
Open

xmaks82 wants to merge 1 commit into
phpmyadmin:masterfrom
xmaks82:export-mariadb-role-grants

Conversation

@xmaks82

@xmaks82 xmaks82 commented Oct 23, 2026

Copy link
Copy Markdown

Description

MariaDB roles are listed in User accounts with an empty host name. Exporting one runs SHOW GRANTS FOR 'role'@'', which fails with error 1141 (There is no such grant defined for user 'role' on host ''), so the export is empty.

To reproduce on MariaDB:

CREATE ROLE r;
GRANT SELECT ON test.* TO r;

User accounts -> Export for r.

On MariaDB, an account with an empty host is now addressed without the host part (SHOW GRANTS FOR 'role'). A test is added.

  • Make sure you have read our CONTRIBUTING.md document.
  • Make sure you are making a pull request against the correct branch. For example, for bug fixes in a released version use the corresponding QA branch and for new features use the master branch. If you have a doubt, you can ask as a comment in the bug report or on the mailing list.
  • Every commit has proper Signed-off-by line as described in our DCO. This ensures that the work you're submitting is your own creation.
  • Every commit has a descriptive commit message.
  • Every commit is needed on its own, if you have just minor fixes to previous commits, you can squash them.
  • Any new functionality is covered by tests.

MariaDB roles are listed with an empty host name, but
SHOW GRANTS FOR 'role'@'' fails with error 1141, so the export of a role
was empty. Address a role without the host part on MariaDB.

Signed-off-by: Магда М.Г. <mail@mgmagda.ru>
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