summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/format/sql_format.cpp
diff options
context:
space:
mode:
authorvitya-smirnov <[email protected]>2026-02-26 18:18:51 +0300
committervitya-smirnov <[email protected]>2026-02-26 19:05:55 +0300
commitdf83fc78eda0422e120490a601fed3f5172007eb (patch)
tree7b73aacc3129e2cb73b76408ff990ff1f63e5da5 /yql/essentials/sql/v1/format/sql_format.cpp
parentfdd66936e2e34659bbd650ba5e48e225f68d2ce6 (diff)
YQL-20538: Fix format on named node line comment
The problem is that a space (`' '`) followed by a openning brace (`(`) were always unconditinally inserted, which is true when it comes just after an assignment (`'='`), but does not work correctly, when an `=` is followed by a comment, so the brace-wrapped select statement should start on a next line. commit_hash:23521a65125e41f199a6244c5501fc17c5b01b85
Diffstat (limited to 'yql/essentials/sql/v1/format/sql_format.cpp')
-rw-r--r--yql/essentials/sql/v1/format/sql_format.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/yql/essentials/sql/v1/format/sql_format.cpp b/yql/essentials/sql/v1/format/sql_format.cpp
index 6be56002834..257ba1dbe91 100644
--- a/yql/essentials/sql/v1/format/sql_format.cpp
+++ b/yql/essentials/sql/v1/format/sql_format.cpp
@@ -993,7 +993,10 @@ private:
case TRule_named_nodes_stmt::TBlock3::kAlt2: {
const auto& alt = msg.GetBlock3().GetAlt2();
- Out(" (");
+ if (OutColumn_ != 0) {
+ Out(' ');
+ }
+ Out('(');
NewLine();
PushCurrentIndent();
Visit(alt);