diff options
author | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-12-12 15:00:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-12 15:00:43 +0000 |
commit | 42701242eaf5be980cb935631586d0e90b82641c (patch) | |
tree | 6dbf5fcd37d3c16591e196c4a69d166e3ab3a398 /yql/essentials/sql/v1/format/sql_format.cpp | |
parent | 7f5a9f394dbd9ac290cabbb7977538656b3a541e (diff) | |
parent | f7c04b5876af3d16849ab5e3079c0eabbd4e3a00 (diff) | |
download | ydb-42701242eaf5be980cb935631586d0e90b82641c.tar.gz |
Merge pull request #12554 from vitalyisaev2/YQ-3839.with_rightlib.3
Import from Arcadia + YDB FQ: turning gateways_config.proto into a file without external dependencies
Diffstat (limited to 'yql/essentials/sql/v1/format/sql_format.cpp')
-rw-r--r-- | yql/essentials/sql/v1/format/sql_format.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/yql/essentials/sql/v1/format/sql_format.cpp b/yql/essentials/sql/v1/format/sql_format.cpp index c029f6e3ad..8c4b04760f 100644 --- a/yql/essentials/sql/v1/format/sql_format.cpp +++ b/yql/essentials/sql/v1/format/sql_format.cpp @@ -62,7 +62,7 @@ void SkipForValidate( while ( in != query.end() && in->Name == "SEMICOLON" && (out == formattedQuery.end() || out->Name != "SEMICOLON") && - in != query.begin() && IsIn({"SEMICOLON", "LBRACE_CURLY", "AS"}, SkipWSOrCommentBackward(in - 1, query.begin())->Name) + in != query.begin() && IsIn({"SEMICOLON", "LBRACE_CURLY", "AS", "BEGIN"}, SkipWSOrCommentBackward(in - 1, query.begin())->Name) ) { in = SkipWS(++in, query.end()); } @@ -562,6 +562,10 @@ private: WriteComments(true); } + if (AfterComment && Comments[LastComment - 1].Content.StartsWith("--")) { + return; + } + if (OutColumn) { Out('\n'); } |