Update tests

This commit is contained in:
Alexey Milovidov 2023-02-02 20:10:59 +01:00
parent 11e89d9aa0
commit bb009fe25d
3 changed files with 32 additions and 31 deletions

View File

@ -16,7 +16,7 @@ alter table test_log_queries.logtable rename column j to x, rename column k to y
alter table test_log_queries.logtable2 add column x int, add column y int 1199561338572582360 Alter ['test_log_queries'] ['test_log_queries.logtable2'] ['test_log_queries.logtable2.x','test_log_queries.logtable2.y']
alter table test_log_queries.logtable3 drop column i, drop column k 340702370038862784 Alter ['test_log_queries'] ['test_log_queries.logtable3'] ['test_log_queries.logtable3.i','test_log_queries.logtable3.k']
rename table test_log_queries.logtable2 to test_log_queries.logtable4, test_log_queries.logtable3 to test_log_queries.logtable5 17256232154191063008 Rename ['test_log_queries'] ['test_log_queries.logtable2','test_log_queries.logtable3','test_log_queries.logtable4','test_log_queries.logtable5'] []
optimize table test_log_queries.logtable 12932884188099170316 ['test_log_queries'] ['test_log_queries.logtable'] []
optimize table test_log_queries.logtable 12932884188099170316 Optimize ['test_log_queries'] ['test_log_queries.logtable'] []
drop table if exists test_log_queries.logtable 9614905142075064664 Drop ['test_log_queries'] ['test_log_queries.logtable'] []
drop table if exists test_log_queries.logtable2 5276868561533661466 Drop ['test_log_queries'] ['test_log_queries.logtable2'] []
drop table if exists test_log_queries.logtable3 4776768361842582387 Drop ['test_log_queries'] ['test_log_queries.logtable3'] []

View File

@ -10,27 +10,27 @@ Misc queries
ACTUAL LOG CONTENT:
Select SELECT \'DROP queries and also a cleanup before the test\';
Drop DROP DATABASE IF EXISTS sqllt SYNC;
DROP USER IF EXISTS sqllt_user;
DROP ROLE IF EXISTS sqllt_role;
DROP POLICY IF EXISTS sqllt_policy ON sqllt.table, sqllt.view, sqllt.dictionary;
DROP ROW POLICY IF EXISTS sqllt_row_policy ON sqllt.table, sqllt.view, sqllt.dictionary;
DROP QUOTA IF EXISTS sqllt_quota;
DROP SETTINGS PROFILE IF EXISTS sqllt_settings_profile;
Drop DROP USER IF EXISTS sqllt_user;
Drop DROP ROLE IF EXISTS sqllt_role;
Drop DROP POLICY IF EXISTS sqllt_policy ON sqllt.table, sqllt.view, sqllt.dictionary;
Drop DROP ROW POLICY IF EXISTS sqllt_row_policy ON sqllt.table, sqllt.view, sqllt.dictionary;
Drop DROP QUOTA IF EXISTS sqllt_quota;
Drop DROP SETTINGS PROFILE IF EXISTS sqllt_settings_profile;
Select SELECT \'CREATE queries\';
Create CREATE DATABASE sqllt;
Create CREATE TABLE sqllt.table\n(\n i UInt8, s String\n)\nENGINE = MergeTree PARTITION BY tuple() ORDER BY tuple();
Create CREATE VIEW sqllt.view AS SELECT i, s FROM sqllt.table;
Create CREATE DICTIONARY sqllt.dictionary (key UInt64, value UInt64) PRIMARY KEY key SOURCE(CLICKHOUSE(DB \'sqllt\' TABLE \'table\' HOST \'localhost\' PORT 9001)) LIFETIME(0) LAYOUT(FLAT());
CREATE USER sqllt_user IDENTIFIED WITH plaintext_password
CREATE ROLE sqllt_role;
CREATE POLICY sqllt_policy ON sqllt.table, sqllt.view, sqllt.dictionary AS PERMISSIVE TO ALL;
CREATE POLICY sqllt_row_policy ON sqllt.table, sqllt.view, sqllt.dictionary AS PERMISSIVE TO ALL;
CREATE QUOTA sqllt_quota KEYED BY user_name TO sqllt_role;
CREATE SETTINGS PROFILE sqllt_settings_profile SETTINGS interactive_delay = 200000;
Create CREATE USER sqllt_user IDENTIFIED WITH plaintext_password
Create CREATE ROLE sqllt_role;
Create CREATE POLICY sqllt_policy ON sqllt.table, sqllt.view, sqllt.dictionary AS PERMISSIVE TO ALL;
Create CREATE POLICY sqllt_row_policy ON sqllt.table, sqllt.view, sqllt.dictionary AS PERMISSIVE TO ALL;
Create CREATE QUOTA sqllt_quota KEYED BY user_name TO sqllt_role;
Create CREATE SETTINGS PROFILE sqllt_settings_profile SETTINGS interactive_delay = 200000;
Grant GRANT sqllt_role TO sqllt_user;
Select SELECT \'SET queries\';
SET log_profile_events=false;
SET DEFAULT ROLE sqllt_role TO sqllt_user;
Set SET log_profile_events=false;
Set SET DEFAULT ROLE sqllt_role TO sqllt_user;
Select -- SET ROLE sqllt_role; -- tests are executed by user `default` which is defined in XML and is impossible to update.\n\nSELECT \'ALTER TABLE queries\';
Alter ALTER TABLE sqllt.table ADD COLUMN new_col UInt32 DEFAULT 123456789;
Alter ALTER TABLE sqllt.table COMMENT COLUMN new_col \'dummy column with a comment\';
@ -54,19 +54,19 @@ System SYSTEM START FETCHES sqllt.table
System SYSTEM STOP REPLICATED SENDS sqllt.table
System SYSTEM START REPLICATED SENDS sqllt.table
Select -- SYSTEM RELOAD DICTIONARY sqllt.dictionary; -- temporary out of order: Code: 210, Connection refused (localhost:9001) (version 21.3.1.1)\n-- DROP REPLICA\n-- haha, no\n-- SYSTEM KILL;\n-- SYSTEM SHUTDOWN;\n\n-- Since we don\'t really care about the actual output, suppress it with `FORMAT Null`.\nSELECT \'SHOW queries\';
SHOW CREATE TABLE sqllt.table FORMAT Null;
SHOW CREATE DICTIONARY sqllt.dictionary FORMAT Null;
SHOW DATABASES LIKE \'sqllt\' FORMAT Null;
SHOW TABLES FROM sqllt FORMAT Null;
SHOW DICTIONARIES FROM sqllt FORMAT Null;
SHOW GRANTS FORMAT Null;
SHOW GRANTS FOR sqllt_user FORMAT Null;
SHOW CREATE USER sqllt_user FORMAT Null;
SHOW CREATE ROLE sqllt_role FORMAT Null;
SHOW CREATE POLICY sqllt_policy FORMAT Null;
SHOW CREATE ROW POLICY sqllt_row_policy FORMAT Null;
SHOW CREATE QUOTA sqllt_quota FORMAT Null;
SHOW CREATE SETTINGS PROFILE sqllt_settings_profile FORMAT Null;
Show SHOW CREATE TABLE sqllt.table FORMAT Null;
Show SHOW CREATE DICTIONARY sqllt.dictionary FORMAT Null;
Show SHOW DATABASES LIKE \'sqllt\' FORMAT Null;
Show SHOW TABLES FROM sqllt FORMAT Null;
Show SHOW DICTIONARIES FROM sqllt FORMAT Null;
Show SHOW GRANTS FORMAT Null;
Show SHOW GRANTS FOR sqllt_user FORMAT Null;
Show SHOW CREATE USER sqllt_user FORMAT Null;
Show SHOW CREATE ROLE sqllt_role FORMAT Null;
Show SHOW CREATE POLICY sqllt_policy FORMAT Null;
Show SHOW CREATE ROW POLICY sqllt_row_policy FORMAT Null;
Show SHOW CREATE QUOTA sqllt_quota FORMAT Null;
Show SHOW CREATE SETTINGS PROFILE sqllt_settings_profile FORMAT Null;
Select SELECT \'GRANT queries\';
Grant GRANT SELECT ON sqllt.table TO sqllt_user;
Grant GRANT DROP ON sqllt.view TO sqllt_user;
@ -74,13 +74,13 @@ Select SELECT \'REVOKE queries\';
Revoke REVOKE SELECT ON sqllt.table FROM sqllt_user;
Revoke REVOKE DROP ON sqllt.view FROM sqllt_user;
Select SELECT \'Misc queries\';
DESCRIBE TABLE sqllt.table FORMAT Null;
CHECK TABLE sqllt.table FORMAT Null;
Describe DESCRIBE TABLE sqllt.table FORMAT Null;
Check CHECK TABLE sqllt.table FORMAT Null;
Drop DETACH TABLE sqllt.table;
Create ATTACH TABLE sqllt.table;
Rename RENAME TABLE sqllt.table TO sqllt.table_new;
Rename RENAME TABLE sqllt.table_new TO sqllt.table;
Drop TRUNCATE TABLE sqllt.table;
Drop DROP TABLE sqllt.table SYNC;
SET log_comment=\'\';
Set SET log_comment=\'\';
DROP queries and also a cleanup after the test

View File

@ -612,6 +612,7 @@ CREATE TABLE system.processes
`memory_usage` Int64,
`peak_memory_usage` Int64,
`query` String,
`query_kind` String,
`thread_ids` Array(UInt64),
`ProfileEvents` Map(String, UInt64),
`Settings` Map(String, String),