diff options
| author | Anel Husakovic <anel@mariadb.org> | 2019-07-04 22:38:47 -0700 |
|---|---|---|
| committer | Anel Husakovic <anel@mariadb.org> | 2019-07-24 23:19:43 -0700 |
| commit | 55d8ff0de8168d3b7d465644dc93dca01f53f4f6 (patch) | |
| tree | afe09128f77ad598a41647caabbc0652e011ac08 /mysql-test/main/grant.test | |
| parent | 0d99ccea1e5d7dab3ece44071c10f5b37f634201 (diff) | |
| download | mariadb-git-55d8ff0de8168d3b7d465644dc93dca01f53f4f6.tar.gz | |
MDEV-19948 `SHOW GRANTS FOR user` return privileges individually
Diffstat (limited to 'mysql-test/main/grant.test')
| -rw-r--r-- | mysql-test/main/grant.test | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/main/grant.test b/mysql-test/main/grant.test index f54c4bd981d..2b8d7337ceb 100644 --- a/mysql-test/main/grant.test +++ b/mysql-test/main/grant.test @@ -2258,3 +2258,40 @@ DROP USER dummy@localhost; --echo # --echo # End of 10.2 tests --echo # + +--echo # +--echo # Start of 10.3 tests +--echo # + +--echo # +--echo # MDEV-19948 'show grants' return privileges individually +--echo # + +# Let's cheat server that we are using `10.2` user table +# which doesn't have `Delete_history_priv` column + +SET @had_user_delete_history_priv := 0; +SELECT @had_user_delete_history_priv :=1 FROM mysql.user WHERE Delete_history_priv LIKE '%'; + +ALTER TABLE mysql.user DROP COLUMN Delete_history_priv; +FLUSH PRIVILEGES; +CREATE USER ten2; +GRANT ALL ON *.* TO ten2; + +# Without any patching, this should show a lot of privileges, +# but without delete history. With patch it is showing `all privileges` +SHOW GRANTS FOR ten2; +FLUSH PRIVILEGES; + +# Now should show `all privileges` with/without patch +SHOW GRANTS FOR ten2; +DROP USER ten2; + +# Restore original table (similar to `mysql_upgrade`) +ALTER TABLE mysql.user ADD Delete_history_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL DEFAULT 'N' after Create_tablespace_priv; +UPDATE mysql.user SET Delete_history_priv = Super_priv WHERE @had_user_delete_history_priv = 1; +FLUSH PRIVILEGES; + +--echo # +--echo # End of 10.3 tests +--echo # |
