Remove DROP TABEL system.query_log from tests

This is a very ugly hack that breaks artifacts, since after this
query_log is incomplete in artifacts.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2023-06-13 16:15:30 +02:00
parent 945981e5f6
commit dc6810601a
6 changed files with 16 additions and 13 deletions

View File

@ -1,9 +1,8 @@
-- Tags: no-parallel
-- Tag no-parallel: Messes with internal cache
-- Start with empty query cache (QC) and query log
-- Start with empty query cache (QC)
SYSTEM DROP QUERY CACHE;
DROP TABLE system.query_log SYNC;
-- Insert an entry into the query cache.
SELECT 1 SETTINGS use_query_cache = true;
@ -22,6 +21,7 @@ SYSTEM FLUSH LOGS;
SELECT ProfileEvents['QueryCacheHits'], ProfileEvents['QueryCacheMisses']
FROM system.query_log
WHERE type = 'QueryFinish'
AND current_database = currentDatabase()
AND query = 'select 1 SETTINGS use_query_cache = true;';
SYSTEM DROP QUERY CACHE;

View File

@ -3,4 +3,5 @@
0 1
---
1
0 1
1 0

View File

@ -1,9 +1,8 @@
-- Tags: no-parallel
-- Tag no-parallel: Messes with internal cache
-- Start with empty query cache QC and query log
-- Start with empty query cache QC
SYSTEM DROP QUERY CACHE;
DROP TABLE system.query_log SYNC;
-- Run a query with QC on. The first execution is a QC miss.
SELECT '---';
@ -13,6 +12,7 @@ SYSTEM FLUSH LOGS;
SELECT ProfileEvents['QueryCacheHits'], ProfileEvents['QueryCacheMisses']
FROM system.query_log
WHERE type = 'QueryFinish'
AND current_database = currentDatabase()
AND query = 'SELECT 1 SETTINGS use_query_cache = true;';
@ -20,11 +20,12 @@ WHERE type = 'QueryFinish'
SELECT '---';
SELECT 1 SETTINGS use_query_cache = true;
DROP TABLE system.query_log SYNC;
SYSTEM FLUSH LOGS;
SELECT ProfileEvents['QueryCacheHits'], ProfileEvents['QueryCacheMisses']
FROM system.query_log
WHERE type = 'QueryFinish'
AND query = 'SELECT 1 SETTINGS use_query_cache = true;';
AND current_database = currentDatabase()
AND query = 'SELECT 1 SETTINGS use_query_cache = true;'
ORDER BY event_time_microseconds;
SYSTEM DROP QUERY CACHE;

View File

@ -1,9 +1,8 @@
-- Tags: no-parallel
-- Tag no-parallel: Messes with internal cache
-- Start with empty query cache (QC) and query log.
-- Start with empty query cache (QC)
SYSTEM DROP QUERY CACHE;
DROP TABLE system.query_log SYNC;
-- Run query whose result gets cached in the query cache.
-- Besides "use_query_cache", pass two more knobs (one QC-specific knob and one non-QC-specific knob). We just care
@ -24,6 +23,7 @@ SYSTEM FLUSH LOGS;
SELECT ProfileEvents['QueryCacheHits'], ProfileEvents['QueryCacheMisses']
FROM system.query_log
WHERE type = 'QueryFinish'
AND current_database = currentDatabase()
AND query = 'SELECT 1 SETTINGS use_query_cache = true, enable_writes_to_query_cache = false, max_threads = 16;';
SYSTEM DROP QUERY CACHE;

View File

@ -9,4 +9,5 @@
-----
1
1
0 1
1 0

View File

@ -22,10 +22,7 @@ SELECT COUNT(*) FROM system.query_cache;
SELECT '-----';
-- Run same query with passive mode again. There must still be one entry in the QC and we must have a QC hit.
-- Get rid of log of previous SELECT
DROP TABLE system.query_log SYNC;
/* Run same query with passive mode again. There must still be one entry in the QC and we must have a QC hit. */
SELECT 1 SETTINGS use_query_cache = true, enable_writes_to_query_cache = false;
SELECT COUNT(*) FROM system.query_cache;
@ -34,6 +31,9 @@ SYSTEM FLUSH LOGS;
SELECT ProfileEvents['QueryCacheHits'], ProfileEvents['QueryCacheMisses']
FROM system.query_log
WHERE type = 'QueryFinish'
AND query = 'SELECT 1 SETTINGS use_query_cache = true, enable_writes_to_query_cache = false;';
AND current_database = currentDatabase()
/* NOTE: client incorrectly join comments from the previous line into query, hence LIKE */
AND query LIKE '%\nSELECT 1 SETTINGS use_query_cache = true, enable_writes_to_query_cache = false;'
ORDER BY event_time_microseconds;
SYSTEM DROP QUERY CACHE;