diff --git a/ydb/library/yql/sql/v1/format/sql_format.cpp b/ydb/library/yql/sql/v1/format/sql_format.cpp index c088adc3e753..a03c9118000a 100644 --- a/ydb/library/yql/sql/v1/format/sql_format.cpp +++ b/ydb/library/yql/sql/v1/format/sql_format.cpp @@ -2236,10 +2236,12 @@ friend struct TStaticData; NewLine(); } - Y_ENSURE(msg.HasBlock4()); - const auto& block = msg.GetBlock4(); - VisitKeyword(block.GetToken1()); - Visit(block.GetRule_expr2()); + if (msg.HasBlock4()) { + const auto& block = msg.GetBlock4(); + VisitKeyword(block.GetToken1()); + Visit(block.GetRule_expr2()); + } + PopCurrentIndent(); NewLine(); Visit(msg.GetToken5());