diff options
author | Alexander Barkov <bar@mariadb.com> | 2020-02-12 18:26:18 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2020-02-28 15:58:31 +0400 |
commit | e26056e181e92332eb622ae096f7faa4e333b4f3 (patch) | |
tree | f6dda57f6c071ddcca953c8d664eee7a1ad69260 /mysql-test/suite/funcs_1 | |
parent | 0c35e80dc9ff24bcb8e710cb8cb16428c8c9986f (diff) | |
download | mariadb-git-e26056e181e92332eb622ae096f7faa4e333b4f3.tar.gz |
MDEV-21704 Add a new JSON field "version_id" into mysql.global_priv.priv
Diffstat (limited to 'mysql-test/suite/funcs_1')
-rw-r--r-- | mysql-test/suite/funcs_1/r/is_user_privileges.result | 33 | ||||
-rw-r--r-- | mysql-test/suite/funcs_1/t/is_user_privileges.test | 26 |
2 files changed, 48 insertions, 11 deletions
diff --git a/mysql-test/suite/funcs_1/r/is_user_privileges.result b/mysql-test/suite/funcs_1/r/is_user_privileges.result index f7a83dd3ddb..27bb2b3de83 100644 --- a/mysql-test/suite/funcs_1/r/is_user_privileges.result +++ b/mysql-test/suite/funcs_1/r/is_user_privileges.result @@ -90,6 +90,7 @@ host localhost user testuser1 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -98,6 +99,7 @@ host localhost user testuser2 json_detailed(priv) { "access": 6, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -106,6 +108,7 @@ host localhost user testuser3 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -138,6 +141,7 @@ host localhost user testuser1 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -146,6 +150,7 @@ host localhost user testuser2 json_detailed(priv) { "access": 6, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -154,6 +159,7 @@ host localhost user testuser3 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -172,6 +178,7 @@ host localhost user testuser1 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -180,6 +187,7 @@ host localhost user testuser2 json_detailed(priv) { "access": 6, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -188,6 +196,7 @@ host localhost user testuser3 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -228,6 +237,7 @@ host localhost user testuser1 json_detailed(priv) { "access": 1, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -236,6 +246,7 @@ host localhost user testuser2 json_detailed(priv) { "access": 6, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -244,6 +255,7 @@ host localhost user testuser3 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -276,6 +288,7 @@ host localhost user testuser1 json_detailed(priv) { "access": 1025, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -284,6 +297,7 @@ host localhost user testuser2 json_detailed(priv) { "access": 6, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -292,6 +306,7 @@ host localhost user testuser3 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -310,6 +325,7 @@ host localhost user testuser1 json_detailed(priv) { "access": 1025, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -318,6 +334,7 @@ host localhost user testuser2 json_detailed(priv) { "access": 6, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -326,6 +343,7 @@ host localhost user testuser3 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -396,6 +414,7 @@ host localhost user testuser1 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -404,6 +423,7 @@ host localhost user testuser2 json_detailed(priv) { "access": 6, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -412,6 +432,7 @@ host localhost user testuser3 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -477,6 +498,7 @@ host localhost user testuser1 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -485,6 +507,7 @@ host localhost user testuser2 json_detailed(priv) { "access": 6, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -493,6 +516,7 @@ host localhost user testuser3 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -511,6 +535,7 @@ host localhost user testuser1 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -519,6 +544,7 @@ host localhost user testuser2 json_detailed(priv) { "access": 6, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -527,6 +553,7 @@ host localhost user testuser3 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -552,6 +579,7 @@ host localhost user testuser1 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -560,6 +588,7 @@ host localhost user testuser2 json_detailed(priv) { "access": 6, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -568,6 +597,7 @@ host localhost user testuser3 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -608,6 +638,7 @@ host localhost user testuser1 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -616,6 +647,7 @@ host localhost user testuser2 json_detailed(priv) { "access": 6, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # @@ -624,6 +656,7 @@ host localhost user testuser3 json_detailed(priv) { "access": 0, + "version_id": VERSION_ID, "plugin": "mysql_native_password", "authentication_string": "", "password_last_changed": # 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 4293c4e16fb..3af56ad2533 100644 --- a/mysql-test/suite/funcs_1/t/is_user_privileges.test +++ b/mysql-test/suite/funcs_1/t/is_user_privileges.test @@ -25,6 +25,10 @@ let $other_engine_type = MyISAM; let $is_table = USER_PRIVILEGES; +let $REGEX_VERSION_ID=/$mysql_get_server_version/VERSION_ID/; +let $REGEX_PASSWORD_LAST_CHANGED=/password_last_changed": [0-9]*/password_last_changed": #/; +let $REGEX_GLOBAL_PRIV=$REGEX_PASSWORD_LAST_CHANGED $REGEX_VERSION_ID; + # The table INFORMATION_SCHEMA.USER_PRIVILEGES must exist eval SHOW TABLES FROM information_schema LIKE '$is_table'; @@ -103,7 +107,7 @@ 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": #/ +--replace_regex $REGEX_GLOBAL_PRIV eval $my_select2; --horizontal_results @@ -112,7 +116,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": #/ +--replace_regex $REGEX_GLOBAL_PRIV eval $my_select2; --horizontal_results @@ -120,7 +124,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": #/ +--replace_regex $REGEX_GLOBAL_PRIV eval $my_select2; --horizontal_results eval $my_show; @@ -134,7 +138,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": #/ +--replace_regex $REGEX_GLOBAL_PRIV eval $my_select2; --horizontal_results @@ -143,7 +147,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": #/ +--replace_regex $REGEX_GLOBAL_PRIV eval $my_select2; --horizontal_results @@ -151,7 +155,7 @@ eval $my_select2; connection testuser1; --vertical_results eval $my_select1; ---replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ +--replace_regex $REGEX_GLOBAL_PRIV eval $my_select2; --horizontal_results eval $my_show; @@ -180,7 +184,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": #/ +--replace_regex $REGEX_GLOBAL_PRIV eval $my_select2; --horizontal_results @@ -213,14 +217,14 @@ GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; GRANT SELECT ON mysql.global_priv TO 'testuser1'@'localhost'; --vertical_results eval $my_select1; ---replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ +--replace_regex $REGEX_GLOBAL_PRIV eval $my_select2; --horizontal_results connection testuser1; --vertical_results eval $my_select1; ---replace_regex /password_last_changed": [0-9]*/password_last_changed": #/ +--replace_regex $REGEX_GLOBAL_PRIV eval $my_select2; --horizontal_results eval $my_show; @@ -233,7 +237,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": #/ +--replace_regex $REGEX_GLOBAL_PRIV eval $my_select2; --horizontal_results eval $my_show; @@ -248,7 +252,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": #/ +--replace_regex $REGEX_GLOBAL_PRIV eval $my_select2; --horizontal_results |