mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
fix bug when column description has settings, ttl and statistics
This commit is contained in:
parent
9caac43b2a
commit
91b62c56d2
@ -157,18 +157,6 @@ void ColumnDescription::writeText(WriteBuffer & buf, IAST::FormatState & state,
|
||||
writeEscapedString(formatASTStateAware(*codec, state), buf);
|
||||
}
|
||||
|
||||
if (!settings.empty())
|
||||
{
|
||||
writeChar('\t', buf);
|
||||
DB::writeText("SETTINGS ", buf);
|
||||
DB::writeText("(", buf);
|
||||
ASTSetQuery ast;
|
||||
ast.is_standalone = false;
|
||||
ast.changes = settings;
|
||||
writeEscapedString(formatASTStateAware(ast, state), buf);
|
||||
DB::writeText(")", buf);
|
||||
}
|
||||
|
||||
if (!statistics.empty())
|
||||
{
|
||||
writeChar('\t', buf);
|
||||
@ -182,6 +170,18 @@ void ColumnDescription::writeText(WriteBuffer & buf, IAST::FormatState & state,
|
||||
writeEscapedString(formatASTStateAware(*ttl, state), buf);
|
||||
}
|
||||
|
||||
if (!settings.empty())
|
||||
{
|
||||
writeChar('\t', buf);
|
||||
DB::writeText("SETTINGS ", buf);
|
||||
DB::writeText("(", buf);
|
||||
ASTSetQuery ast;
|
||||
ast.is_standalone = false;
|
||||
ast.changes = settings;
|
||||
writeEscapedString(formatASTStateAware(ast, state), buf);
|
||||
DB::writeText(")", buf);
|
||||
}
|
||||
|
||||
writeChar('\n', buf);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,5 @@
|
||||
drop table if exists t1;
|
||||
SET allow_experimental_statistics = 1;
|
||||
create table t1 (d Datetime, c0 Int TTL d + INTERVAL 1 MONTH SETTINGS (max_compress_block_size = 1), c2 Int STATISTICS(Uniq) SETTINGS (max_compress_block_size = 1)) Engine = MergeTree() ORDER BY ();
|
||||
insert into t1 values ('2024-11-15 18:30:00', 25, 20);
|
||||
|
Loading…
Reference in New Issue
Block a user