-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Cannot cancel queries when scalar subqueries are being calculated #1576
Copy link
Copy link
Labels
Description
!!!
UPD: if you face that issue - please post the sample of the query in comments after checking if reproduces
!!!
Some queries can't be killed - nor with replace query, nor with kill query.
Sample:
SELECT version()
┌─version()─┐
│ 1.1.54304 │
└───────────┘
1 rows in set. Elapsed: 0.001 sec.
:) select (SELECT max(number) from system.numbers) + 1;
SELECT
(
SELECT max(number)
FROM system.numbers
) + 1
^CCancelling query.
^C
> clickhouse-client -m
ClickHouse client version 1.1.54304.
Connecting to localhost:9000.
Connected to ClickHouse server version 1.1.54304.
:) show processlist;
SHOW PROCESSLIST
┌─is_initial_query─┬─user────┬─query_id─────────────────────────────┬─address─┬──port─┬─initial_user─┬─initial_query_id─────────────────────┬─initial_address─┬─initial_port─┬─interface─┬─os_user─┬─client_hostname─┬─client_name───────┬─client_version_major─┬─client_version_minor─┬─client_revision─┬─http_method─┬─http_user_agent─┬─quota_key─┬──────elapsed─┬─read_rows─┬─read_bytes─┬─total_rows_approx─┬─written_rows─┬─written_bytes─┬─memory_usage─┬─query───────────────────────────────────────────────┐
│ 1 │ default │ 400f52a9-fa09-42ba-856a-aeb442f56b79 │ ::1 │ 47312 │ default │ 400f52a9-fa09-42ba-856a-aeb442f56b79 │ ::1 │ 47312 │ 1 │ name │ host │ ClickHouse client │ 1 │ 1 │ 54304 │ 0 │ │ │ 18.055088508 │ 0 │ 0 │ 0 │ 0 │ 0 │ 1052672 │ select (SELECT max(number) from system.numbers) + 1 │
└──────────────────┴─────────┴──────────────────────────────────────┴─────────┴───────┴──────────────┴──────────────────────────────────────┴─────────────────┴──────────────┴───────────┴─────────┴─────────────────┴───────────────────┴──────────────────────┴──────────────────────┴─────────────────┴─────────────┴─────────────────┴───────────┴──────────────┴───────────┴────────────┴───────────────────┴──────────────┴───────────────┴──────────────┴─────────────────────────────────────────────────────┘
(only server restart helps)
Also max_execution_time is able to kill that query by timeout.
Reactions are currently unavailable