v.20.6Improvement

Added KILL QUERY command for MySQL client to cancel long-running queries

Added KILL QUERY [connection_id] for the MySQL client/driver to cancel the long query, issue #12038. #12152 (BohuTANG).
Added support for the KILL QUERY [connection_id] command in the MySQL client protocol to allow cancellation of long-running queries.

Why it matters

This feature addresses the need to terminate long-running queries initiated through MySQL-compatible clients or drivers, improving resource management and user control over query execution.

How to use it

Users can cancel a running query by executing the following command using a MySQL client or driver connected to ClickHouse:

KILL QUERY [connection_id];

where connection_id is the identifier of the session running the query to be killed.