ClickHouse/tests/queries/0_stateless/01292_create_user.reference
2022-12-13 12:48:14 +01:00

118 lines
5.1 KiB
Plaintext

-- default
CREATE USER u1_01292
-- same as default
CREATE USER u2_01292
CREATE USER u3_01292
-- rename
CREATE USER u2_01292_renamed
-- authentication
CREATE USER u1_01292
CREATE USER u2_01292 IDENTIFIED WITH plaintext_password
CREATE USER u3_01292 IDENTIFIED WITH sha256_password
CREATE USER u4_01292 IDENTIFIED WITH sha256_password
CREATE USER u5_01292 IDENTIFIED WITH sha256_password
CREATE USER u6_01292 IDENTIFIED WITH double_sha1_password
CREATE USER u7_01292 IDENTIFIED WITH double_sha1_password
CREATE USER u1_01292 IDENTIFIED WITH sha256_password
CREATE USER u2_01292 IDENTIFIED WITH sha256_password
CREATE USER u3_01292 IDENTIFIED WITH sha256_password
CREATE USER u4_01292 IDENTIFIED WITH plaintext_password
CREATE USER u5_01292
-- host
CREATE USER u1_01292
CREATE USER u2_01292 HOST NONE
CREATE USER u3_01292 HOST LOCAL
CREATE USER u4_01292 HOST NAME \'myhost.com\'
CREATE USER u5_01292 HOST LOCAL, NAME \'myhost.com\'
CREATE USER u6_01292 HOST LOCAL, NAME \'myhost.com\'
CREATE USER u7_01292 HOST REGEXP \'.*\\\\.myhost\\\\.com\'
CREATE USER u8_01292
CREATE USER u9_01292 HOST LIKE \'%.myhost.com\'
CREATE USER u10_01292 HOST LIKE \'%.myhost.com\'
CREATE USER u11_01292 HOST LOCAL
CREATE USER u12_01292 HOST IP \'192.168.1.1\'
CREATE USER u13_01292 HOST IP \'192.168.0.0/16\'
CREATE USER u14_01292 HOST LOCAL
CREATE USER u15_01292 HOST IP \'2001:db8:11a3:9d7:1f34:8a2e:7a0:765d\'
CREATE USER u16_01292 HOST LOCAL, IP \'65:ff0c::/96\'
CREATE USER u1_01292 HOST NONE
CREATE USER u2_01292 HOST NAME \'myhost.com\'
CREATE USER u3_01292 HOST LOCAL, NAME \'myhost.com\'
CREATE USER u4_01292 HOST NONE
-- host after @
CREATE USER u1_01292
CREATE USER u1_01292
CREATE USER `u2_01292@%.myhost.com` HOST LIKE \'%.myhost.com\'
CREATE USER `u2_01292@%.myhost.com` HOST LIKE \'%.myhost.com\'
CREATE USER `u3_01292@192.168.%.%` HOST LIKE \'192.168.%.%\'
CREATE USER `u3_01292@192.168.%.%` HOST LIKE \'192.168.%.%\'
CREATE USER `u4_01292@::1` HOST LOCAL
CREATE USER `u4_01292@::1` HOST LOCAL
CREATE USER `u5_01292@65:ff0c::/96` HOST LIKE \'65:ff0c::/96\'
CREATE USER `u5_01292@65:ff0c::/96` HOST LIKE \'65:ff0c::/96\'
CREATE USER u1_01292 HOST LOCAL
CREATE USER `u2_01292@%.myhost.com`
-- settings
CREATE USER u1_01292
CREATE USER u2_01292 SETTINGS PROFILE default
CREATE USER u3_01292 SETTINGS max_memory_usage = 5000000
CREATE USER u4_01292 SETTINGS max_memory_usage MIN 5000000
CREATE USER u5_01292 SETTINGS max_memory_usage MAX 5000000
CREATE USER u6_01292 SETTINGS max_memory_usage CONST
CREATE USER u7_01292 SETTINGS max_memory_usage WRITABLE
CREATE USER u8_01292 SETTINGS max_memory_usage = 5000000 MIN 4000000 MAX 6000000 CONST
CREATE USER u9_01292 SETTINGS PROFILE default, max_memory_usage = 5000000 WRITABLE
CREATE USER u1_01292 SETTINGS readonly = 1
CREATE USER u2_01292 SETTINGS readonly = 1
CREATE USER u3_01292
-- default role
CREATE USER u1_01292
CREATE USER u2_01292 DEFAULT ROLE NONE
CREATE USER u3_01292 DEFAULT ROLE r1_01292
CREATE USER u4_01292 DEFAULT ROLE r1_01292, r2_01292
CREATE USER u5_01292 DEFAULT ROLE ALL EXCEPT r2_01292
CREATE USER u6_01292 DEFAULT ROLE ALL EXCEPT r1_01292, r2_01292
CREATE USER u1_01292 DEFAULT ROLE r1_01292
CREATE USER u2_01292 DEFAULT ROLE ALL EXCEPT r2_01292
CREATE USER u3_01292 DEFAULT ROLE r2_01292
CREATE USER u4_01292
CREATE USER u5_01292 DEFAULT ROLE ALL EXCEPT r1_01292
CREATE USER u6_01292 DEFAULT ROLE NONE
-- complex
CREATE USER u1_01292 IDENTIFIED WITH plaintext_password HOST LOCAL SETTINGS readonly = 1
CREATE USER u1_01292 HOST LIKE \'%.%.myhost.com\' DEFAULT ROLE NONE SETTINGS PROFILE default
-- if not exists
CREATE USER u1_01292
GRANT r1_01292 TO u1_01292
-- if not exists-part2
CREATE USER u1_01292
GRANT r1_01292, r2_01292 TO u1_01292
-- or replace
CREATE USER u1_01292
CREATE USER u2_01292
-- multiple users in one command
CREATE USER u1_01292 DEFAULT ROLE NONE
CREATE USER u2_01292 DEFAULT ROLE NONE
CREATE USER u3_01292 HOST LIKE \'%.%.myhost.com\'
CREATE USER u4_01292 HOST LIKE \'%.%.myhost.com\'
CREATE USER `u5_01292@%.host.com` HOST LIKE \'%.host.com\'
CREATE USER `u6_01292@%.host.com` HOST LIKE \'%.host.com\'
CREATE USER `u7_01292@%.host.com` HOST LIKE \'%.host.com\'
CREATE USER `u8_01292@%.otherhost.com` HOST LIKE \'%.otherhost.com\'
CREATE USER u1_01292 DEFAULT ROLE NONE SETTINGS readonly = 1
CREATE USER u2_01292 DEFAULT ROLE r1_01292, r2_01292 SETTINGS readonly = 1
CREATE USER u3_01292 HOST LIKE \'%.%.myhost.com\' DEFAULT ROLE r1_01292, r2_01292
CREATE USER u4_01292 HOST LIKE \'%.%.myhost.com\' DEFAULT ROLE r1_01292, r2_01292
-- system.users
u1_01292 local directory plaintext_password {} [] ['localhost'] [] [] 1 [] []
u2_01292 local directory no_password {} [] [] [] ['%.%.myhost.com'] 0 [] []
u3_01292 local directory sha256_password {} ['192.169.1.1','192.168.0.0/16'] ['localhost'] [] [] 0 ['r1_01292'] []
u4_01292 local directory double_sha1_password {} ['::/0'] [] [] [] 1 [] ['r1_01292']
-- system.settings_profile_elements
\N u1_01292 \N 0 readonly 1 \N \N \N \N
\N u2_01292 \N 0 \N \N \N \N \N default
\N u3_01292 \N 0 max_memory_usage 5000000 4000000 6000000 WRITABLE \N
\N u4_01292 \N 0 \N \N \N \N \N default
\N u4_01292 \N 1 max_memory_usage 5000000 \N \N \N \N
\N u4_01292 \N 2 readonly 1 \N \N \N \N