ClickHouse/tests/queries/0_stateless/01297_create_quota.reference
2024-01-29 23:20:38 +00:00

104 lines
5.3 KiB
Plaintext

-- default
CREATE QUOTA q1_01297
-- same as default
CREATE QUOTA q2_01297
CREATE QUOTA q3_01297
CREATE QUOTA q4_01297
-- rename
CREATE QUOTA q2_01297_renamed
-- key
CREATE QUOTA q1_01297
CREATE QUOTA q2_01297 KEYED BY user_name
CREATE QUOTA q3_01297 KEYED BY ip_address
CREATE QUOTA q4_01297 KEYED BY client_key
CREATE QUOTA q5_01297 KEYED BY client_key, user_name
CREATE QUOTA q6_01297 KEYED BY client_key, ip_address
CREATE QUOTA q7_01297
CREATE QUOTA q8_01297 KEYED BY user_name
CREATE QUOTA q9_01297 KEYED BY ip_address
CREATE QUOTA q10_01297 KEYED BY client_key
CREATE QUOTA q11_01297 KEYED BY client_key, user_name
CREATE QUOTA q12_01297 KEYED BY client_key, ip_address
CREATE QUOTA q1_01297 KEYED BY user_name
CREATE QUOTA q2_01297 KEYED BY client_key, user_name
CREATE QUOTA q3_01297
-- intervals
CREATE QUOTA q1_01297 FOR INTERVAL 5 day MAX errors = 3
CREATE QUOTA q2_01297 FOR INTERVAL 30 minute MAX errors = 4
CREATE QUOTA q3_01297 FOR INTERVAL 1 hour MAX errors = 5
CREATE QUOTA q4_01297 FOR INTERVAL 2000 second MAX errors = 5
CREATE QUOTA q5_01297 FOR RANDOMIZED INTERVAL 1 year MAX queries = 100, errors = 11
CREATE QUOTA q6_01297 FOR INTERVAL 2 month MAX queries = 100, errors = 11, result_rows = 1000, result_bytes = 10000, read_rows = 1001, read_bytes = 10001, execution_time = 2.5
CREATE QUOTA q7_01297 FOR INTERVAL 1 quarter MAX queries = 100, errors = 11
CREATE QUOTA q8_01297 FOR INTERVAL 2 month MAX result_rows = 1002, FOR INTERVAL 2 quarter MAX queries = 100, errors = 11
CREATE QUOTA q1_01297
CREATE QUOTA q2_01297 FOR INTERVAL 30 minute TRACKING ONLY
CREATE QUOTA q3_01297 FOR INTERVAL 1 hour MAX queries = 70, FOR INTERVAL 2 hour MAX errors = 10
CREATE QUOTA q4_01297 FOR RANDOMIZED INTERVAL 2000 second MAX errors = 5
CREATE QUOTA q5_01297 FOR INTERVAL 1 year MAX errors = 111
-- to roles
CREATE QUOTA q1_01297
CREATE QUOTA q2_01297 TO ALL
CREATE QUOTA q3_01297 TO r1_01297
CREATE QUOTA q4_01297 TO u1_01297
CREATE QUOTA q5_01297 TO r1_01297, u1_01297
CREATE QUOTA q6_01297 TO ALL EXCEPT r1_01297
CREATE QUOTA q7_01297 TO ALL EXCEPT r1_01297, u1_01297
CREATE QUOTA q1_01297 TO u1_01297
CREATE QUOTA q2_01297
-- multiple quotas in one command
CREATE QUOTA q1_01297 FOR INTERVAL 1 day MAX errors = 5
CREATE QUOTA q2_01297 FOR INTERVAL 1 day MAX errors = 5
CREATE QUOTA q1_01297 FOR INTERVAL 1 day TRACKING ONLY TO r1_01297
CREATE QUOTA q2_01297 FOR INTERVAL 1 day TRACKING ONLY TO r1_01297
-- system.quotas
q1_01297 local_directory ['user_name'] [] 0 ['r1_01297'] []
q2_01297 local_directory [] [5259492] 0 ['r1_01297','u1_01297'] []
q3_01297 local_directory ['client_key','user_name'] [5259492,15778476] 0 [] []
q4_01297 local_directory [] [604800] 1 [] ['u1_01297']
-- system.quota_limits
q2_01297 5259492 0 100 \N \N 11 1000 10000 1001 10001 2.5 \N \N
q3_01297 5259492 0 \N \N \N \N 1002 \N \N \N \N \N \N
q3_01297 15778476 0 100 \N \N 11 \N \N \N \N \N \N \N
q4_01297 604800 0 \N \N \N \N \N \N \N \N \N \N \N
-- query_selects query_inserts
CREATE QUOTA q1_01297 KEYED BY user_name FOR INTERVAL 1 minute MAX query_selects = 1 TO r1_01297
CREATE QUOTA q2_01297 KEYED BY user_name FOR INTERVAL 1 minute MAX query_inserts = 1 TO r1_01297
-- size suffix
-- functional test
CREATE QUOTA q1_01297 FOR INTERVAL 1 minute MAX query_selects = 12000
CREATE QUOTA q2_01297 FOR INTERVAL 1 minute MAX query_selects = 12288
CREATE QUOTA q3_01297 FOR INTERVAL 1 minute MAX query_selects = 12000000
CREATE QUOTA q4_01297 FOR INTERVAL 1 minute MAX query_selects = 12582912
CREATE QUOTA q5_01297 FOR INTERVAL 1 minute MAX query_selects = 12000000000
CREATE QUOTA q6_01297 FOR INTERVAL 1 minute MAX query_selects = 12884901888
CREATE QUOTA q7_01297 FOR INTERVAL 1 minute MAX query_selects = 12000000000000
CREATE QUOTA q8_01297 FOR INTERVAL 1 minute MAX query_selects = 13194139533312
CREATE QUOTA q9_01297 FOR INTERVAL 1 minute MAX execution_time = 12000
CREATE QUOTA q10_01297 FOR INTERVAL 1 minute MAX execution_time = 12288
CREATE QUOTA q11_01297 FOR INTERVAL 1 minute MAX execution_time = 12000000
CREATE QUOTA q12_01297 FOR INTERVAL 1 minute MAX execution_time = 12582912
CREATE QUOTA q13_01297 FOR INTERVAL 1 minute MAX execution_time = 12000000000
CREATE QUOTA q14_01297 FOR INTERVAL 1 minute MAX execution_time = 12884901888
CREATE QUOTA q15_01297 FOR INTERVAL 1 minute MAX query_selects = 1
CREATE QUOTA q16_01297 FOR INTERVAL 1 minute MAX execution_time = 1.5
-- overflow test
CREATE QUOTA q1_01297 FOR INTERVAL 1 minute MAX query_selects = 18446744073709551615
CREATE QUOTA q2_01297 FOR INTERVAL 1 minute MAX execution_time = 18446744073
-- zero test
CREATE QUOTA q1_01297 FOR INTERVAL 1 minute MAX query_selects = 0
CREATE QUOTA q2_01297 FOR INTERVAL 1 minute MAX execution_time = 0
-- underflow test
-- syntax test
CREATE QUOTA q1_01297 FOR INTERVAL 1 minute MAX query_selects = 12
CREATE QUOTA q2_01297 FOR INTERVAL 1 minute MAX execution_time = 12
CREATE QUOTA q3_01297 FOR INTERVAL 1 minute MAX query_selects = 12000
CREATE QUOTA q4_01297 FOR INTERVAL 1 minute MAX execution_time = 12000
CREATE QUOTA q5_01297 FOR INTERVAL 1 minute MAX execution_time = 0
CREATE QUOTA q6_01297 FOR INTERVAL 1 minute MAX execution_time = 0
CREATE QUOTA q7_01297 FOR INTERVAL 1 minute MAX execution_time = 0
CREATE QUOTA q8_01297 FOR INTERVAL 1 minute MAX execution_time = 0
CREATE QUOTA q9_01297 FOR INTERVAL 1 minute MAX execution_time = 123000
CREATE QUOTA q10_01297 FOR INTERVAL 1 minute MAX execution_time = 123000
-- bad syntax test