diff --git a/src/Server/TCPHandler.cpp b/src/Server/TCPHandler.cpp index 119f601563a..981a59caefe 100644 --- a/src/Server/TCPHandler.cpp +++ b/src/Server/TCPHandler.cpp @@ -728,6 +728,7 @@ void TCPHandler::processOrdinaryQueryWithProcessors() return; sendData({}); + last_sent_snapshots.clear(); } sendProgress(); diff --git a/tests/queries/0_stateless/02050_client_profile_events.reference b/tests/queries/0_stateless/02050_client_profile_events.reference index c8e031d3562..7ca88730e16 100644 --- a/tests/queries/0_stateless/02050_client_profile_events.reference +++ b/tests/queries/0_stateless/02050_client_profile_events.reference @@ -4,6 +4,9 @@ print only last (and also number of rows to provide more info in case of failure [ 0 ] SelectedRows: 131010 (increment) regression test for incorrect filtering out snapshots 0 +regression test for overlap profile events snapshots between queries +[ 0 ] SelectedRows: 1 (increment) +[ 0 ] SelectedRows: 1 (increment) print everything OK print each 100 ms diff --git a/tests/queries/0_stateless/02050_client_profile_events.sh b/tests/queries/0_stateless/02050_client_profile_events.sh index 5470c44594c..6117f971fd5 100755 --- a/tests/queries/0_stateless/02050_client_profile_events.sh +++ b/tests/queries/0_stateless/02050_client_profile_events.sh @@ -14,6 +14,9 @@ echo 'regression test for incorrect filtering out snapshots' $CLICKHOUSE_CLIENT --print-profile-events --profile-events-delay-ms=-1 -n -q 'select 1; select 1' >& /dev/null echo $? +echo 'regression test for overlap profile events snapshots between queries' +$CLICKHOUSE_CLIENT --print-profile-events --profile-events-delay-ms=-1 -n -q 'select 1; select 1' |& grep -F -o '[ 0 ] SelectedRows: 1 (increment)' + echo 'print everything' profile_events="$($CLICKHOUSE_CLIENT --max_block_size 1 --print-profile-events -q 'select sleep(1) from numbers(2) format Null' |& grep -c 'SelectedRows')" test "$profile_events" -gt 1 && echo OK || echo "FAIL ($profile_events)"