From 04de6ccc318ea52124399312223b8c0dc0d8fc7b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 1 Mar 2014 11:55:31 +0100 Subject: MDEV-5668 Assertion `granted_role->is_role()' fails on granting role with empty name parser: error out on empty role names --- mysql-test/suite/roles/grant_empty.result | 14 +++++++++++++ mysql-test/suite/roles/grant_empty.test | 23 ++++++++++++++++++++++ .../suite/roles/show_grants_anon-5238.result | 12 ----------- mysql-test/suite/roles/show_grants_anon-5238.test | 17 ---------------- 4 files changed, 37 insertions(+), 29 deletions(-) create mode 100644 mysql-test/suite/roles/grant_empty.result create mode 100644 mysql-test/suite/roles/grant_empty.test delete mode 100644 mysql-test/suite/roles/show_grants_anon-5238.result delete mode 100644 mysql-test/suite/roles/show_grants_anon-5238.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/roles/grant_empty.result b/mysql-test/suite/roles/grant_empty.result new file mode 100644 index 00000000000..dfc0f513396 --- /dev/null +++ b/mysql-test/suite/roles/grant_empty.result @@ -0,0 +1,14 @@ +grant '' to foo@localhost; +ERROR OP000: Invalid role specification ``. +create user ''@localhost; +create role r1; +grant r1 to ''@localhost; +select current_user; +current_user +@localhost +show grants; +Grants for @localhost +GRANT r1 TO ''@'localhost' +GRANT USAGE ON *.* TO ''@'localhost' +drop role r1; +drop user ''@localhost; diff --git a/mysql-test/suite/roles/grant_empty.test b/mysql-test/suite/roles/grant_empty.test new file mode 100644 index 00000000000..e419fffa2ba --- /dev/null +++ b/mysql-test/suite/roles/grant_empty.test @@ -0,0 +1,23 @@ +# +# MDEV-5668 Assertion `granted_role->is_role()' fails on granting role with empty name +# +--error ER_INVALID_ROLE +grant '' to foo@localhost; + +# +# MDEV-5238 Server crashes in find_role_grant_pair on SHOW GRANTS for an anonymous user +# +--source include/not_embedded.inc + +create user ''@localhost; +create role r1; +grant r1 to ''@localhost; + +--connect (con1,localhost,nonexisting_user,,) +select current_user; +show grants; + +connection default; +drop role r1; +drop user ''@localhost; + diff --git a/mysql-test/suite/roles/show_grants_anon-5238.result b/mysql-test/suite/roles/show_grants_anon-5238.result deleted file mode 100644 index 85be1ac92f3..00000000000 --- a/mysql-test/suite/roles/show_grants_anon-5238.result +++ /dev/null @@ -1,12 +0,0 @@ -create user ''@localhost; -create role r1; -grant r1 to ''@localhost; -select current_user; -current_user -@localhost -show grants; -Grants for @localhost -GRANT r1 TO ''@'localhost' -GRANT USAGE ON *.* TO ''@'localhost' -drop role r1; -drop user ''@localhost; diff --git a/mysql-test/suite/roles/show_grants_anon-5238.test b/mysql-test/suite/roles/show_grants_anon-5238.test deleted file mode 100644 index adb22490233..00000000000 --- a/mysql-test/suite/roles/show_grants_anon-5238.test +++ /dev/null @@ -1,17 +0,0 @@ -# -# MDEV-5238 Server crashes in find_role_grant_pair on SHOW GRANTS for an anonymous user -# ---source include/not_embedded.inc - -create user ''@localhost; -create role r1; -grant r1 to ''@localhost; - ---connect (con1,localhost,nonexisting_user,,) -select current_user; -show grants; - -connection default; -drop role r1; -drop user ''@localhost; - -- cgit v1.2.1