Skip to content

Commit ce10854

Browse files
committed
Fixed bugs
1 parent 6f6984f commit ce10854

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

ydb/tests/tools/kqprun/kqprun.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ class TMain : public TMainClassArgs {
424424
.Handler1([this](const NLastGetopt::TOptsParser* option) {
425425
if (const TString& port = option->CurVal()) {
426426
RunnerOptions.YdbSettings.MonitoringEnabled = true;
427-
RunnerOptions.YdbSettings.MonitoringPortOffset = FromString(port.c_str());
427+
RunnerOptions.YdbSettings.MonitoringPortOffset = FromString(port);
428428
}
429429
});
430430

ydb/tests/tools/kqprun/src/kqp_runner.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,16 @@ class TKqpRunner::TImpl {
199199
if (Options_.InFlightLimit && AsyncState_.InFlight >= Options_.InFlightLimit) {
200200
AwaitInFlight_.WaitI(Mutex_);
201201
}
202-
203202
ui64 requestId = AsyncState_.OnStartRequest();
203+
Cout << TStringBuilder() << CoutColors_.Cyan() << TInstant::Now().ToIsoStringLocal() << " Request #" << requestId << " started. " << CoutColors_.Yellow() << AsyncState_.GetInfoString() << CoutColors_.Default() << "\n";
204+
204205
RunningQueries_[requestId] = YdbSetup_.QueryRequestAsync(query, action, traceId, nullptr).Subscribe([this, requestId](const NThreading::TFuture<NKqpRun::TQueryResult>& f) {
205206
TGuard<TMutex> lock(Mutex_);
206207

207208
auto response = f.GetValue().Response;
208209
AsyncState_.OnRequestFinished(response.IsSuccess());
209210
if (response.IsSuccess()) {
210-
Cout << CoutColors_.Green() << TInstant::Now().ToIsoStringLocal() << " Request #" << requestId << " completed. " << CoutColors_.Yellow() << AsyncState_.GetInfoString() << CoutColors_.Default() << "\n";
211+
Cout << CoutColors_.Green() << TInstant::Now().ToIsoStringLocal() << " Request #" << requestId << " completed. " << CoutColors_.Yellow() << AsyncState_.GetInfoString() << CoutColors_.Default() << Endl;
211212
} else {
212213
Cout << CoutColors_.Red() << TInstant::Now().ToIsoStringLocal() << " Request #" << requestId << " failed " << response.Status << ". " << CoutColors_.Yellow() << AsyncState_.GetInfoString() << "\n" << CoutColors_.Red() << "Issues:\n" << response.Issues.ToString() << CoutColors_.Default();
213214
}
@@ -220,7 +221,6 @@ class TKqpRunner::TImpl {
220221
}
221222
RunningQueries_.erase(requestId);
222223
}).IgnoreResult();
223-
Cout << TStringBuilder() << CoutColors_.Cyan() << TInstant::Now().ToIsoStringLocal() << " Request #" << requestId << " started. " << CoutColors_.Yellow() << AsyncState_.GetInfoString() << CoutColors_.Default() << "\n";
224224
}
225225

226226
void WaitAsyncQueries() {
@@ -263,12 +263,14 @@ class TKqpRunner::TImpl {
263263
}
264264

265265
void PrintScriptResults() const {
266-
Cout << CoutColors_.Cyan() << "Writing script query results" << CoutColors_.Default() << Endl;
267-
for (size_t i = 0; i < ResultSets_.size(); ++i) {
268-
if (ResultSets_.size() > 1) {
269-
*Options_.ResultOutput << CoutColors_.Cyan() << "Result set " << i + 1 << ":" << CoutColors_.Default() << Endl;
266+
if (Options_.ResultOutput) {
267+
Cout << CoutColors_.Cyan() << "Writing script query results" << CoutColors_.Default() << Endl;
268+
for (size_t i = 0; i < ResultSets_.size(); ++i) {
269+
if (ResultSets_.size() > 1) {
270+
*Options_.ResultOutput << CoutColors_.Cyan() << "Result set " << i + 1 << ":" << CoutColors_.Default() << Endl;
271+
}
272+
PrintScriptResult(ResultSets_[i]);
270273
}
271-
PrintScriptResult(ResultSets_[i]);
272274
}
273275
}
274276

0 commit comments

Comments
 (0)