From 02262e3b6e4ed910cfa4999b38aa678c1c7c2ea1 Mon Sep 17 00:00:00 2001 From: Vitaly Baranov Date: Thu, 6 Feb 2020 05:24:44 +0300 Subject: [PATCH] Add one more test. --- .../01075_allowed_client_hosts.reference | 14 ++++++ .../01075_allowed_client_hosts.sql | 47 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/01075_allowed_client_hosts.reference create mode 100644 dbms/tests/queries/0_stateless/01075_allowed_client_hosts.sql diff --git a/dbms/tests/queries/0_stateless/01075_allowed_client_hosts.reference b/dbms/tests/queries/0_stateless/01075_allowed_client_hosts.reference new file mode 100644 index 00000000000..dadef736cce --- /dev/null +++ b/dbms/tests/queries/0_stateless/01075_allowed_client_hosts.reference @@ -0,0 +1,14 @@ +CREATE USER test_user_01075 +CREATE USER test_user_01075 +CREATE USER test_user_01075 HOST NONE +CREATE USER test_user_01075 HOST LOCAL +CREATE USER test_user_01075 HOST IP \'192.168.23.15\' +CREATE USER test_user_01075 HOST IP \'2001:db8:11a3:9d7:1f34:8a2e:7a0:765d\' +CREATE USER test_user_01075 HOST LOCAL, IP \'2001:db8:11a3:9d7:1f34:8a2e:7a0:765d\' +CREATE USER test_user_01075 HOST LOCAL +CREATE USER test_user_01075 HOST NONE +CREATE USER test_user_01075 HOST LIKE \'@.somesite.com\' +CREATE USER test_user_01075 HOST NAME REGEXP \'.*.anothersite.com\' +CREATE USER `test_user_01075_x@localhost` HOST LOCAL +CREATE USER test_user_01075_x +CREATE USER `test_user_01075_x@192.168.23.15` HOST LIKE \'192.168.23.15\' diff --git a/dbms/tests/queries/0_stateless/01075_allowed_client_hosts.sql b/dbms/tests/queries/0_stateless/01075_allowed_client_hosts.sql new file mode 100644 index 00000000000..6ffd8caf746 --- /dev/null +++ b/dbms/tests/queries/0_stateless/01075_allowed_client_hosts.sql @@ -0,0 +1,47 @@ +DROP USER IF EXISTS test_user_01075, test_user_01075_x, test_user_01075_x@localhost, test_user_01075_x@'192.168.23.15'; + +CREATE USER test_user_01075; +SHOW CREATE USER test_user_01075; + +ALTER USER test_user_01075 HOST ANY; +SHOW CREATE USER test_user_01075; + +ALTER USER test_user_01075 HOST NONE; +SHOW CREATE USER test_user_01075; + +ALTER USER test_user_01075 HOST LOCAL; +SHOW CREATE USER test_user_01075; + +ALTER USER test_user_01075 HOST IP '192.168.23.15'; +SHOW CREATE USER test_user_01075; + +ALTER USER test_user_01075 HOST IP '2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d'; +SHOW CREATE USER test_user_01075; + +ALTER USER test_user_01075 ADD HOST IP '127.0.0.1'; +SHOW CREATE USER test_user_01075; + +ALTER USER test_user_01075 REMOVE HOST IP '2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d'; +SHOW CREATE USER test_user_01075; + +ALTER USER test_user_01075 REMOVE HOST NAME 'localhost'; +SHOW CREATE USER test_user_01075; + +ALTER USER test_user_01075 HOST LIKE '@.somesite.com'; +SHOW CREATE USER test_user_01075; + +ALTER USER test_user_01075 HOST NAME REGEXP '.*\.anothersite\.com'; +SHOW CREATE USER test_user_01075; + +DROP USER test_user_01075; + +CREATE USER test_user_01075_x@localhost; +SHOW CREATE USER test_user_01075_x@localhost; + +ALTER USER test_user_01075_x@localhost RENAME TO test_user_01075_x@'@'; +SHOW CREATE USER test_user_01075_x; + +ALTER USER test_user_01075_x RENAME TO test_user_01075_x@'192.168.23.15'; +SHOW CREATE USER 'test_user_01075_x@192.168.23.15'; + +DROP USER 'test_user_01075_x@192.168.23.15';