Skip to content

Commit dde41da

Browse files
committed
Fixes
1 parent 55b4a87 commit dde41da

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ void TCommandExecuteQuery::PrintDataQueryResponse(NTable::TDataQueryResult& resu
551551
NJson::ReadJsonTree(*meta, &metaJson, true);
552552
diagnosticsJson.InsertValue("meta", metaJson);
553553
}
554-
file << NJson::PrettifyJson(NJson::WriteJson(diagnosticsJson, true), false);
554+
file << NJson::PrettifyJson(NJson::WriteJson(diagnosticsJson, true), true);
555555
}
556556

557557
if (FlameGraphPath && !stats.has_value()) {
@@ -796,7 +796,9 @@ bool TCommandExecuteQuery::PrintQueryResponse(TIterator& result) {
796796
if (queryStats.GetPlan()) {
797797
fullStats = queryStats.GetPlan();
798798
}
799-
meta = queryStats.GetMeta();
799+
if (queryStats.GetMeta()) {
800+
meta = queryStats.GetMeta();
801+
}
800802
}
801803
}
802804
} // TResultSetPrinter destructor should be called before printing stats
@@ -838,7 +840,7 @@ bool TCommandExecuteQuery::PrintQueryResponse(TIterator& result) {
838840
metaJson.InsertValue("query_text", EscapeC(Query));
839841
diagnosticsJson.InsertValue("meta", metaJson);
840842
}
841-
file << NJson::PrettifyJson(NJson::WriteJson(diagnosticsJson, true), false);
843+
file << NJson::PrettifyJson(NJson::WriteJson(diagnosticsJson, true), true);
842844
}
843845

844846
PrintFlameGraph(fullStats);

ydb/public/lib/ydb_cli/commands/ydb_sql.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,13 @@ int TCommandSql::PrintResponse(NQuery::TExecuteQueryIterator& result) {
206206
const auto& queryStats = *streamPart.GetStats();
207207
stats = queryStats.ToString();
208208
ast = queryStats.GetAst();
209-
meta = queryStats.GetMeta();
210209

211210
if (queryStats.GetPlan()) {
212211
plan = queryStats.GetPlan();
213212
}
214-
meta = queryStats.GetMeta();
213+
if (queryStats.GetMeta()) {
214+
meta = queryStats.GetMeta();
215+
}
215216
}
216217
}
217218
} // TResultSetPrinter destructor should be called before printing stats
@@ -269,7 +270,7 @@ int TCommandSql::PrintResponse(NQuery::TExecuteQueryIterator& result) {
269270
metaJson.InsertValue("query_text", EscapeC(Query));
270271
diagnosticsJson.InsertValue("meta", metaJson);
271272
}
272-
file << NJson::PrettifyJson(NJson::WriteJson(diagnosticsJson, true), false);
273+
file << NJson::PrettifyJson(NJson::WriteJson(diagnosticsJson, true), true);
273274
}
274275

275276
if (IsInterrupted()) {

0 commit comments

Comments
 (0)