diff options
Diffstat (limited to 'mysql-test/main')
-rw-r--r-- | mysql-test/main/grant5.result | 24 | ||||
-rw-r--r-- | mysql-test/main/grant5.test | 19 |
2 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/main/grant5.result b/mysql-test/main/grant5.result index 908a05aadf1..dc8ee527378 100644 --- a/mysql-test/main/grant5.result +++ b/mysql-test/main/grant5.result @@ -296,4 +296,28 @@ drop database db; drop user foo@localhost; drop user bar@localhost; drop user buz@localhost; +CREATE USER foo; +CREATE DATABASE db; +CREATE TABLE db.test_getcolpriv(col1 INT, col2 INT); +GRANT SELECT (col1,col2) ON db.test_getcolpriv TO foo; +GRANT INSERT (col1) ON db.test_getcolpriv TO foo; +SHOW GRANTS FOR foo; +Grants for foo@% +GRANT USAGE ON *.* TO `foo`@`%` +GRANT SELECT (col2, col1), INSERT (col1) ON `db`.`test_getcolpriv` TO `foo`@`%` +REVOKE SELECT (col1,col2) ON db.test_getcolpriv FROM foo; +SHOW GRANTS FOR foo; +Grants for foo@% +GRANT USAGE ON *.* TO `foo`@`%` +GRANT INSERT (col1) ON `db`.`test_getcolpriv` TO `foo`@`%` +REVOKE INSERT (col1) ON db.test_getcolpriv FROM foo; +SHOW GRANTS FOR foo; +Grants for foo@% +GRANT USAGE ON *.* TO `foo`@`%` +FLUSH PRIVILEGES; +SHOW GRANTS FOR foo; +Grants for foo@% +GRANT USAGE ON *.* TO `foo`@`%` +DROP USER foo; +DROP DATABASE db; # End of 10.3 tests diff --git a/mysql-test/main/grant5.test b/mysql-test/main/grant5.test index 35df5a6ec03..cff63d2a9f9 100644 --- a/mysql-test/main/grant5.test +++ b/mysql-test/main/grant5.test @@ -259,4 +259,23 @@ drop user foo@localhost; drop user bar@localhost; drop user buz@localhost; +CREATE USER foo; +CREATE DATABASE db; +CREATE TABLE db.test_getcolpriv(col1 INT, col2 INT); + +GRANT SELECT (col1,col2) ON db.test_getcolpriv TO foo; +GRANT INSERT (col1) ON db.test_getcolpriv TO foo; + +SHOW GRANTS FOR foo; +REVOKE SELECT (col1,col2) ON db.test_getcolpriv FROM foo; +SHOW GRANTS FOR foo; +REVOKE INSERT (col1) ON db.test_getcolpriv FROM foo; + +SHOW GRANTS FOR foo; +FLUSH PRIVILEGES; +SHOW GRANTS FOR foo; + +DROP USER foo; +DROP DATABASE db; + --echo # End of 10.3 tests |