2020-09-15 02:43:47 +00:00
|
|
|
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
|
2021-01-26 19:56:11 +00:00
|
|
|
WHERE current_database = currentDatabase()
|
2021-04-09 19:57:40 +00:00
|
|
|
AND query like 'SELECT \'01461_query%'
|
|
|
|
AND event_date >= yesterday()
|
2020-09-15 02:43:47 +00:00
|
|
|
ORDER BY query_start_time DESC
|
|
|
|
LIMIT 1
|
|
|
|
) AS time_with_microseconds,
|
|
|
|
(
|
|
|
|
SELECT query_start_time
|
|
|
|
FROM system.query_log
|
2021-01-26 19:56:11 +00:00
|
|
|
WHERE current_database = currentDatabase()
|
2021-04-09 19:57:40 +00:00
|
|
|
AND query like 'SELECT \'01461_query%'
|
|
|
|
AND event_date >= yesterday()
|
2020-09-15 02:43:47 +00:00
|
|
|
ORDER BY query_start_time DESC
|
|
|
|
LIMIT 1
|
|
|
|
) AS t)
|
|
|
|
SELECT if(dateDiff('second', toDateTime(time_with_microseconds), toDateTime(t)) = 0, 'ok', 'fail'); --
|
2020-08-30 07:05:18 +00:00
|
|
|
|
2022-05-10 23:25:41 +00:00
|
|
|
SET log_query_threads = 1;
|
2020-09-15 02:43:47 +00:00
|
|
|
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
|
2021-01-26 19:56:11 +00:00
|
|
|
WHERE current_database = currentDatabase()
|
2021-04-09 19:57:40 +00:00
|
|
|
AND query like 'SELECT \'01461_query%'
|
|
|
|
AND event_date >= yesterday()
|
2020-09-15 02:43:47 +00:00
|
|
|
ORDER BY query_start_time DESC
|
|
|
|
LIMIT 1
|
|
|
|
) AS time_with_microseconds,
|
|
|
|
(
|
|
|
|
SELECT query_start_time
|
|
|
|
FROM system.query_thread_log
|
2021-01-26 19:56:11 +00:00
|
|
|
WHERE current_database = currentDatabase()
|
2021-04-09 19:57:40 +00:00
|
|
|
AND query like 'SELECT \'01461_query%'
|
|
|
|
AND event_date >= yesterday()
|
2020-09-15 02:43:47 +00:00
|
|
|
ORDER BY query_start_time DESC
|
|
|
|
LIMIT 1
|
|
|
|
) AS t)
|
2021-01-26 19:56:11 +00:00
|
|
|
SELECT if(dateDiff('second', toDateTime(time_with_microseconds), toDateTime(t)) = 0, 'ok', 'fail'); --
|