mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
QueryLog,QueryThreadLOg - better test for query_start_time_microseconds
This commit is contained in:
parent
e4e3105014
commit
90e0ef9b70
@ -1,9 +1,36 @@
|
||||
set log_queries = 1;
|
||||
SET log_queries = 1;
|
||||
SELECT '01461_query_log_query_start_time_milliseconds_test';
|
||||
SYSTEM FLUSH LOGS;
|
||||
-- assumes that the query_start_time field is already accurate.
|
||||
WITH (
|
||||
(
|
||||
SELECT query_start_time_microseconds
|
||||
FROM system.query_log
|
||||
ORDER BY query_start_time DESC
|
||||
LIMIT 1
|
||||
) AS time_with_microseconds,
|
||||
(
|
||||
SELECT query_start_time
|
||||
FROM system.query_log
|
||||
ORDER BY query_start_time DESC
|
||||
LIMIT 1
|
||||
) AS t)
|
||||
SELECT if(dateDiff('second', toDateTime(time_with_microseconds), toDateTime(t)) = 0, 'ok', 'fail'); --
|
||||
|
||||
select '01461_query_log_query_start_time_milliseconds_test';
|
||||
system flush logs;
|
||||
SELECT If((select count(query_start_time_microseconds) from system.query_log WHERE query LIKE '%01461_query_log_query_start_time_milliseconds_test%' AND query NOT LIKE '%system.query_log%') > 0, 'ok', 'fail');
|
||||
|
||||
select '01461_query_thread_log_query_start_time_milliseconds_test';
|
||||
system flush logs;
|
||||
SELECT If((select count(query_start_time_microseconds) from system.query_log WHERE query LIKE '%01461_query_thread_log_query_start_time_milliseconds_test%' AND query NOT LIKE '%system.query_log%') > 0, 'ok', 'fail');
|
||||
SELECT '01461_query_thread_log_query_start_time_milliseconds_test';
|
||||
SYSTEM FLUSH LOGS;
|
||||
-- assumes that the query_start_time field is already accurate.
|
||||
WITH (
|
||||
(
|
||||
SELECT query_start_time_microseconds
|
||||
FROM system.query_thread_log
|
||||
ORDER BY query_start_time DESC
|
||||
LIMIT 1
|
||||
) AS time_with_microseconds,
|
||||
(
|
||||
SELECT query_start_time
|
||||
FROM system.query_thread_log
|
||||
ORDER BY query_start_time DESC
|
||||
LIMIT 1
|
||||
) AS t)
|
||||
SELECT if(dateDiff('second', toDateTime(time_with_microseconds), toDateTime(t)) = 0, 'ok', 'fail'); --
|
Loading…
Reference in New Issue
Block a user