ClickHouse/tests/queries/0_stateless/02905_system_logs_hostname.sql
Bharat Nallan Chakravarthy f21e8ec5d6 add another test
2023-10-28 00:08:42 -07:00

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;