mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fixed error with empty TinyLog table; added a test from Nickolay Kovalev #2563
This commit is contained in:
parent
b714d87de7
commit
d2a44248cd
@ -245,6 +245,10 @@ void TinyLogBlockOutputStream::writeSuffix()
|
||||
return;
|
||||
done = true;
|
||||
|
||||
/// If nothing was written - leave the table in initial state.
|
||||
if (streams.empty())
|
||||
return;
|
||||
|
||||
/// Finish write.
|
||||
for (auto & stream : streams)
|
||||
stream.second->finalize();
|
||||
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,14 @@
|
||||
DROP TABLE IF EXISTS test.empty;
|
||||
DROP TABLE IF EXISTS test.data;
|
||||
|
||||
CREATE TABLE test.empty (value Int8) ENGINE = TinyLog;
|
||||
CREATE TABLE test.data (value Int8) ENGINE = TinyLog;
|
||||
|
||||
INSERT INTO test.data SELECT * FROM empty;
|
||||
SELECT * FROM test.data;
|
||||
|
||||
INSERT INTO test.data SELECT 1;
|
||||
SELECT * FROM test.data;
|
||||
|
||||
DROP TABLE test.empty;
|
||||
DROP TABLE test.data;
|
Loading…
Reference in New Issue
Block a user