mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Merge pull request #36803 from CurtizJ/fix-unflatten-nested
Fix creation of tables with `flatten_nested = 0`
This commit is contained in:
commit
b98ac57090
@ -589,7 +589,7 @@ ColumnsDescription InterpreterCreateQuery::getColumnsDescription(
|
||||
res.add(std::move(column));
|
||||
}
|
||||
|
||||
if (context_->getSettingsRef().flatten_nested)
|
||||
if (!attach && context_->getSettingsRef().flatten_nested)
|
||||
res.flattenNested();
|
||||
|
||||
if (res.getAllPhysical().empty())
|
||||
|
@ -0,0 +1,4 @@
|
||||
CREATE TABLE default.t_nested_detach\n(\n `n` Nested(u UInt32, s String)\n)\nENGINE = Log
|
||||
n Nested(u UInt32, s String)
|
||||
CREATE TABLE default.t_nested_detach\n(\n `n` Nested(u UInt32, s String)\n)\nENGINE = Log
|
||||
n Nested(u UInt32, s String)
|
@ -0,0 +1,17 @@
|
||||
DROP TABLE IF EXISTS t_nested_detach;
|
||||
|
||||
SET flatten_nested = 0;
|
||||
CREATE TABLE t_nested_detach (n Nested(u UInt32, s String)) ENGINE = Log;
|
||||
|
||||
SHOW CREATE TABLE t_nested_detach;
|
||||
DESC TABLE t_nested_detach;
|
||||
|
||||
SET flatten_nested = 1;
|
||||
|
||||
DETACH TABLE t_nested_detach;
|
||||
ATTACH TABLE t_nested_detach;
|
||||
|
||||
SHOW CREATE TABLE t_nested_detach;
|
||||
DESC TABLE t_nested_detach;
|
||||
|
||||
DROP TABLE IF EXISTS t_nested_detach;
|
Loading…
Reference in New Issue
Block a user