diff --git a/dbms/src/Storages/LiveView/LiveViewEventsBlockInputStream.h b/dbms/src/Storages/LiveView/LiveViewEventsBlockInputStream.h index 3308ff2858b90304ff2836393446c71afbaea1a2..14cfade338de1bb2fdf4f5e542a88bcadaf5cd83 100644 --- a/dbms/src/Storages/LiveView/LiveViewEventsBlockInputStream.h +++ b/dbms/src/Storages/LiveView/LiveViewEventsBlockInputStream.h @@ -213,12 +213,8 @@ protected: // move right to the end it = end; - - if (it == end) - { - end_of_blocks = false; - num_updates += 1; - } + end_of_blocks = false; + num_updates += 1; last_event_timestamp_usec = static_cast(timestamp.epochMicroseconds()); diff --git a/dbms/src/Storages/LiveView/StorageLiveView.cpp b/dbms/src/Storages/LiveView/StorageLiveView.cpp index b6877c52752bf6fd2f9d069e7f297048eb5164cc..089c7ccd47e8b24ac889338e174ec2af931ca122 100644 --- a/dbms/src/Storages/LiveView/StorageLiveView.cpp +++ b/dbms/src/Storages/LiveView/StorageLiveView.cpp @@ -499,8 +499,7 @@ BlockInputStreams StorageLiveView::read( const size_t /*max_block_size*/, const unsigned /*num_streams*/) { - /// add user to the blocks_ptr - std::shared_ptr stream_blocks_ptr = blocks_ptr; + std::shared_ptr stream; { std::lock_guard lock(mutex); if (!(*blocks_ptr)) @@ -508,8 +507,9 @@ BlockInputStreams StorageLiveView::read( if (getNewBlocks()) condition.notify_all(); } + stream = std::make_shared(blocks_ptr, getHeader()); } - return { std::make_shared(stream_blocks_ptr, getHeader()) }; + return { stream }; } BlockInputStreams StorageLiveView::watch( diff --git a/dbms/tests/queries/0_stateless/helpers/client.py b/dbms/tests/queries/0_stateless/helpers/client.py index f3938d3bf636cb6f472861c4cb618ed3a09b1c7f..04e6d782d2cf6d47fb977047634540dee5b29632 100644 --- a/dbms/tests/queries/0_stateless/helpers/client.py +++ b/dbms/tests/queries/0_stateless/helpers/client.py @@ -15,7 +15,7 @@ class client(object): def __init__(self, command=None, name='', log=None): self.client = uexpect.spawn(['/bin/bash','--noediting']) if command is None: - command = os.environ.get('CLICKHOUSE_BINARY', 'clickhouse') + '-client' + command = os.environ.get('CLICKHOUSE_BINARY', 'clickhouse') + ' client' self.client.command = command self.client.eol('\r') self.client.logger(log, prefix=name)