Fix tests

This commit is contained in:
Vasily Nemkov 2021-03-01 10:41:49 +02:00
parent 6af4d06dff
commit bfc5cb47cc
2 changed files with 13 additions and 10 deletions

View File

@ -8,15 +8,15 @@ GRANT queries
REVOKE queries
Misc queries
ACTUAL LOG CONTENT:
Select -- SET ROLE sqllt_role; -- tests are executed by user `default` which is defined in XML and is impossble to update.\n\nSELECT \'ALTER TABLE queries\';
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\';
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\';
Select -- not done, seems to hard, so I\'ve skipped queries of ALTER-X, where X is:\n-- PARTITION\n-- ORDER BY\n-- SAMPLE BY\n-- INDEX\n-- CONSTRAINT\n-- TTL\n-- USER\n-- QUOTA\n-- ROLE\n-- ROW POLICY\n-- SETTINGS PROFILE\n\nSELECT \'SYSTEM queries\';
Alter ALTER TABLE table ADD COLUMN new_col UInt32 DEFAULT 1;
Alter ALTER TABLE table ADD COLUMN new_col UInt32 DEFAULT 123456789;
Alter ALTER TABLE table CLEAR COLUMN new_col;
Alter ALTER TABLE table COMMENT COLUMN new_col \'dummy column with a comment\';
Alter ALTER TABLE table DELETE WHERE i > 65535;
Alter ALTER TABLE table DROP COLUMN the_new_col;
Alter ALTER TABLE table MODIFY COLUMN new_col FixedString(12) DEFAULT \'Hello world!\';
Alter ALTER TABLE table MODIFY COLUMN new_col DateTime DEFAULT \'2015-05-18 07:40:13\';
Alter ALTER TABLE table MODIFY COLUMN new_col REMOVE COMMENT;
Alter ALTER TABLE table RENAME COLUMN new_col TO the_new_col;
Alter ALTER TABLE table UPDATE i = i + 1 WHERE 1;
@ -69,7 +69,6 @@ Select SELECT \'SET queries\';
SHOW GRANTS FOR sqllt_user FORMAT Null;
SHOW GRANTS FORMAT Null;
SHOW TABLES FROM sqllt FORMAT Null;
System SYSTEM DROP COMPILED EXPRESSION CACHE;
System SYSTEM DROP DNS CACHE;
System SYSTEM DROP MARK CACHE;
System SYSTEM DROP UNCOMPRESSED CACHE;

View File

@ -38,13 +38,13 @@ GRANT sqllt_role TO sqllt_user;
SELECT 'SET queries';
SET log_profile_events=false;
SET DEFAULT ROLE sqllt_role TO sqllt_user;
-- SET ROLE sqllt_role; -- tests are executed by user `default` which is defined in XML and is impossble to update.
-- SET ROLE sqllt_role; -- tests are executed by user `default` which is defined in XML and is impossible to update.
SELECT 'ALTER TABLE queries';
ALTER TABLE table ADD COLUMN new_col UInt32 DEFAULT 1;
ALTER TABLE table ADD COLUMN new_col UInt32 DEFAULT 123456789;
ALTER TABLE table COMMENT COLUMN new_col 'dummy column with a comment';
ALTER TABLE table CLEAR COLUMN new_col;
ALTER TABLE table MODIFY COLUMN new_col FixedString(12) DEFAULT 'Hello world!';
ALTER TABLE table MODIFY COLUMN new_col DateTime DEFAULT '2015-05-18 07:40:13';
ALTER TABLE table MODIFY COLUMN new_col REMOVE COMMENT;
ALTER TABLE table RENAME COLUMN new_col TO the_new_col;
ALTER TABLE table DROP COLUMN the_new_col;
@ -70,7 +70,6 @@ SYSTEM RELOAD DICTIONARIES;
SYSTEM DROP DNS CACHE;
SYSTEM DROP MARK CACHE;
SYSTEM DROP UNCOMPRESSED CACHE;
SYSTEM DROP COMPILED EXPRESSION CACHE;
SYSTEM FLUSH LOGS;
SYSTEM RELOAD CONFIG;
SYSTEM STOP MERGES;
@ -133,8 +132,13 @@ TRUNCATE TABLE sqllt.table;
SYSTEM FLUSH LOGS;
SELECT 'ACTUAL LOG CONTENT:';
-- Try to filter out all possible previous junk events by excluding old log entries
SELECT query_kind, query FROM system.query_log WHERE log_comment LIKE '%system.query_log%' AND type == 'QueryStart' AND query_start_time >= now() - 5 ORDER BY query;
-- Try to filter out all possible previous junk events by excluding old log entries,
SELECT query_kind, query FROM system.query_log
WHERE
log_comment LIKE '%system.query_log%' AND type == 'QueryStart' AND query_start_time >= now() - 5
-- this one is to make stylecheck happy and to validate that CREATE\DROP queries of non-db-bound-objects, like USER\ROLS are logged properly.
AND (current_database == currentDatabase() OR current_database != currentDatabase())
ORDER BY query;
-- cleanup