This commit is contained in:
feng lv 2020-10-08 17:18:56 +08:00
parent 23fa408403
commit 3bcb9b8db5
2 changed files with 3 additions and 1 deletions

View File

@ -159,7 +159,7 @@ Pipe StorageMemory::read(
metadata_snapshot,
/// This hack is needed for global subqueries.
/// It allows to set up this Source for read AFTER Storage::read() has been called and just before actual reading
[this](BlocksList::const_iterator & current_it, size_t & num_blocks) {
[this, &current_data](BlocksList::const_iterator & current_it, size_t & num_blocks) {
std::lock_guard guard(mutex);
current_it = current_data->begin();
num_blocks = current_data->size();

View File

@ -94,6 +94,8 @@ private:
/// MultiVersion data storage, so that we can copy the list of blocks to readers.
MultiVersion<BlocksList> data;
mutable std::mutex mutex;
bool delay_read_for_global_subqueries = false;
std::atomic<size_t> total_size_bytes = 0;