mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
fix defaults mismatch size
This commit is contained in:
parent
1b97cb3f95
commit
45d0089d3f
@ -62,6 +62,9 @@ Block AddingDefaultsBlockInputStream::readImpl()
|
||||
if (evaluate_block.has(column.first))
|
||||
evaluate_block.erase(column.first);
|
||||
|
||||
if (!evaluate_block.columns())
|
||||
evaluate_block.insert({ColumnConst::create(ColumnUInt8::create(1, 0), res.rows()), std::make_shared<DataTypeUInt8>(), "_dummy"});
|
||||
|
||||
evaluateMissingDefaults(evaluate_block, header.getNamesAndTypesList(), column_defaults, context, false);
|
||||
|
||||
std::unordered_map<size_t, MutableColumnPtr> mixed_columns;
|
||||
|
@ -0,0 +1,4 @@
|
||||
1 hello
|
||||
2 test2
|
||||
42 test42
|
||||
42 world
|
@ -0,0 +1,10 @@
|
||||
DROP TABLE IF EXISTS defaults_all_columns;
|
||||
|
||||
CREATE TABLE defaults_all_columns (n UInt8 DEFAULT 42, s String DEFAULT concat('test', CAST(n, 'String'))) ENGINE = Memory;
|
||||
|
||||
INSERT INTO defaults_all_columns FORMAT JSONEachRow {"n": 1, "s": "hello"} {};
|
||||
INSERT INTO defaults_all_columns FORMAT JSONEachRow {"n": 2}, {"s": "world"};
|
||||
|
||||
SELECT * FROM defaults_all_columns ORDER BY n, s;
|
||||
|
||||
DROP TABLE defaults_all_columns;
|
Loading…
Reference in New Issue
Block a user