diff options
Diffstat (limited to 'mysql-test/suite/funcs_1/t/is_user_privileges.test')
-rw-r--r-- | mysql-test/suite/funcs_1/t/is_user_privileges.test | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/mysql-test/suite/funcs_1/t/is_user_privileges.test b/mysql-test/suite/funcs_1/t/is_user_privileges.test index a61e9187d15..4293c4e16fb 100644 --- a/mysql-test/suite/funcs_1/t/is_user_privileges.test +++ b/mysql-test/suite/funcs_1/t/is_user_privileges.test @@ -77,9 +77,6 @@ WHERE table_catalog IS NULL OR table_catalog <> 'def'; # 3.2.16.4: Ensure that the table does not show any information on any # privileges that are not user privileges for the current user. # ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings CREATE DATABASE db_datadict; --error 0,ER_CANNOT_USER @@ -93,7 +90,7 @@ DROP USER 'testuser3'@'localhost'; CREATE USER 'testuser3'@'localhost'; GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost'; -GRANT SELECT ON mysql.user TO 'testuser1'@'localhost'; +GRANT SELECT ON mysql.global_priv TO 'testuser1'@'localhost'; GRANT INSERT ON *.* TO 'testuser2'@'localhost'; GRANT UPDATE ON *.* TO 'testuser2'@'localhost'; @@ -101,11 +98,12 @@ GRANT UPDATE ON *.* TO 'testuser2'@'localhost'; let $my_select1= SELECT * FROM information_schema.user_privileges WHERE grantee LIKE '''testuser%''' ORDER BY grantee, table_catalog, privilege_type; -let $my_select2= SELECT * FROM mysql.user +let $my_select2= SELECT host,user,json_detailed(priv) FROM mysql.global_priv WHERE user LIKE 'testuser%' ORDER BY host, user; let $my_show= SHOW GRANTS; --vertical_results eval $my_select1; +--replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ eval $my_select2; --horizontal_results @@ -114,6 +112,7 @@ eval $my_select2; GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; --vertical_results eval $my_select1; +--replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ eval $my_select2; --horizontal_results @@ -121,6 +120,7 @@ eval $my_select2; connect (testuser1, localhost, testuser1, , db_datadict); --vertical_results eval $my_select1; +--replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ eval $my_select2; --horizontal_results eval $my_show; @@ -134,6 +134,7 @@ GRANT SELECT ON *.* TO 'testuser1'@'localhost'; --echo # Here <SELECT NO> is shown correctly for testuser1; --vertical_results eval $my_select1; +--replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ eval $my_select2; --horizontal_results @@ -142,6 +143,7 @@ GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION; --echo # Here <SELECT YES> is shown correctly for testuser1; --vertical_results eval $my_select1; +--replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ eval $my_select2; --horizontal_results @@ -149,6 +151,7 @@ eval $my_select2; connection testuser1; --vertical_results eval $my_select1; +--replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ eval $my_select2; --horizontal_results eval $my_show; @@ -177,6 +180,7 @@ connection default; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost'; --vertical_results eval $my_select1; +--replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ eval $my_select2; --horizontal_results @@ -203,18 +207,20 @@ eval $my_show; CREATE TABLE db_datadict.tb_66 ( c1 TEXT ); --echo ---echo # Add ALL on db_datadict.* (and select on mysql.user) to testuser1; +--echo # Add ALL on db_datadict.* (and select on mysql.global_priv) to testuser1; connection default; GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; -GRANT SELECT ON mysql.user TO 'testuser1'@'localhost'; +GRANT SELECT ON mysql.global_priv TO 'testuser1'@'localhost'; --vertical_results eval $my_select1; +--replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ eval $my_select2; --horizontal_results connection testuser1; --vertical_results eval $my_select1; +--replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ eval $my_select2; --horizontal_results eval $my_show; @@ -227,6 +233,7 @@ CREATE TABLE db_datadict.tb_56 ( c1 TEXT ); USE db_datadict; --vertical_results eval $my_select1; +--replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ eval $my_select2; --horizontal_results eval $my_show; @@ -241,6 +248,7 @@ connection default; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost'; --vertical_results eval $my_select1; +--replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ eval $my_select2; --horizontal_results |