Fix clickhouse-test for server w/o is_all_data_sent in system.processes

This commit is contained in:
Azat Khuzhin 2022-04-28 23:16:30 +03:00
parent d8fa806fca
commit 287c098c7e

View File

@ -225,7 +225,7 @@ def get_processlist_after_test(args):
FROM clusterAllReplicas('test_cluster_database_replicated', system.processes)
WHERE
query NOT LIKE '%system.processes%' AND
NOT is_all_data_sent AND
{'NOT is_all_data_sent AND' if args.suppport_system_processes_is_all_data_sent else ''}
Settings['log_comment'] = '{log_comment}' AND
current_database = '{database}'
""")
@ -235,7 +235,7 @@ def get_processlist_after_test(args):
FROM system.processes
WHERE
query NOT LIKE '%system.processes%' AND
NOT is_all_data_sent AND
{'NOT is_all_data_sent AND' if args.suppport_system_processes_is_all_data_sent else ''}
Settings['log_comment'] = '{log_comment}' AND
current_database = '{database}'
""")
@ -1235,6 +1235,12 @@ def collect_build_flags(args):
return result
def check_table_column(args, database, table, column):
return int(clickhouse_execute(args, f"""
SELECT count()
FROM system.columns
WHERE database = '{database}' AND table = '{table}' AND name = '{column}'
""")) > 0
def suite_key_func(item: str) -> Union[int, Tuple[int, str]]:
if args.order == 'random':
@ -1338,6 +1344,7 @@ def main(args):
raise Exception(msg)
args.build_flags = collect_build_flags(args)
args.suppport_system_processes_is_all_data_sent = check_table_column(args, 'system', 'processes', 'is_all_data_sent')
if args.skip:
args.skip = set(args.skip)