diff --git a/dbms/src/Storages/System/StorageSystemZeros.cpp b/dbms/src/Storages/System/StorageSystemZeros.cpp index ae9bf3d0902..aad9baca47e 100644 --- a/dbms/src/Storages/System/StorageSystemZeros.cpp +++ b/dbms/src/Storages/System/StorageSystemZeros.cpp @@ -118,7 +118,7 @@ Pipes StorageSystemZeros::read( for (size_t i = 0; i < num_streams; ++i) { - auto source = std::make_shared(max_block_size, *limit, state); + auto source = std::make_shared(max_block_size, limit ? *limit : 0, state); if (limit && i == 0) source->addTotalRowsApprox(*limit);