diff --git a/dbms/include/DB/DataStreams/RemoteBlockInputStream.h b/dbms/include/DB/DataStreams/RemoteBlockInputStream.h index 327e41f2310..77640c73439 100644 --- a/dbms/include/DB/DataStreams/RemoteBlockInputStream.h +++ b/dbms/include/DB/DataStreams/RemoteBlockInputStream.h @@ -36,7 +36,7 @@ public: void cancel() { - if (!was_cancelled && !finished) + if (sent_query && !was_cancelled && !finished && !got_exception_from_server) { LOG_TRACE(log, "Cancelling query");