mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
27 lines
679 B
SQL
27 lines
679 B
SQL
SELECT 'test hostname in system log tables';
|
|
|
|
set log_query_threads=1;
|
|
set log_queries_min_type='QUERY_FINISH';
|
|
set log_queries=1;
|
|
select '02095_system_logs_hostname' from system.one format Null;
|
|
set log_queries=0;
|
|
set log_query_threads=0;
|
|
|
|
system flush logs;
|
|
|
|
select hostname
|
|
from system.query_log
|
|
where
|
|
query like 'select \'02095_system_logs_hostname%'
|
|
and current_database = currentDatabase()
|
|
and event_date >= yesterday() LIMIT 1 FORMAT Null;
|
|
|
|
|
|
select hostName(), hostname
|
|
from system.query_thread_log
|
|
where
|
|
query like 'select \'02095_system_logs_hostname%'
|
|
and current_database = currentDatabase()
|
|
and event_date >= yesterday() LIMIT 1 FORMAT Null;
|
|
|