aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrgayazov <bulat@ydb.tech>2023-04-07 17:37:25 +0300
committerbrgayazov <bulat@ydb.tech>2023-04-07 17:37:25 +0300
commitc380bc59f03b81aa0c557d43f2e437a8ba01e443 (patch)
tree03a79f5071ca3cad87cab4f6f7e3af241269ae40
parentc2ca4487e67405e557ea3b875106d2b0f3e70429 (diff)
downloadydb-c380bc59f03b81aa0c557d43f2e437a8ba01e443.tar.gz
Fixed the check for empty endpoint and database
-rw-r--r--ydb/public/lib/ydb_cli/commands/ydb_service_scripting.cpp4
-rw-r--r--ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp6
-rw-r--r--ydb/public/lib/ydb_cli/commands/ydb_yql.cpp6
3 files changed, 8 insertions, 8 deletions
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_scripting.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_scripting.cpp
index 6ccb862be07..617a622c741 100644
--- a/ydb/public/lib/ydb_cli/commands/ydb_service_scripting.cpp
+++ b/ydb/public/lib/ydb_cli/commands/ydb_service_scripting.cpp
@@ -87,8 +87,6 @@ void TCommandExecuteYqlScript::Parse(TConfig& config) {
if (ScriptFile) {
Script = ReadFromFile(ScriptFile, "script");
}
- ValidateResult = MakeHolder<NScripting::TExplainYqlResult>(
- ExplainQuery(config, Script, NScripting::ExplainYqlRequestMode::Validate));
ParseParameters(config);
}
@@ -108,6 +106,8 @@ int TCommandExecuteYqlScript::Run(TConfig& config) {
settings.CollectQueryStats(ParseQueryStatsMode(CollectStatsMode, NTable::ECollectQueryStatsMode::None));
if (!Parameters.empty() || !IsStdinInteractive()) {
+ ValidateResult = MakeHolder<NScripting::TExplainYqlResult>(
+ ExplainQuery(config, Script, NScripting::ExplainYqlRequestMode::Validate));
THolder<TParamsBuilder> paramBuilder;
while (GetNextParams(ValidateResult->GetParameterTypes(), InputFormat, StdinFormat, FramingFormat, paramBuilder)) {
auto asyncResult = client.ExecuteYqlScript(
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp
index 19832aef73d..b89bcdd15fd 100644
--- a/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp
+++ b/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp
@@ -401,8 +401,6 @@ void TCommandExecuteQuery::Parse(TConfig& config) {
}
CheckQueryOptions();
CheckQueryFile();
- ValidateResult = MakeHolder<NScripting::TExplainYqlResult>(
- ExplainQuery(config, Query, NScripting::ExplainYqlRequestMode::Validate));
ParseParameters(config);
}
@@ -447,6 +445,8 @@ int TCommandExecuteQuery::ExecuteDataQuery(TConfig& config) {
NTable::TAsyncDataQueryResult asyncResult;
if (!Parameters.empty() || !IsStdinInteractive()) {
+ ValidateResult = MakeHolder<NScripting::TExplainYqlResult>(
+ ExplainQuery(config, Query, NScripting::ExplainYqlRequestMode::Validate));
THolder<TParamsBuilder> paramBuilder;
while (GetNextParams(ValidateResult->GetParameterTypes(), InputFormat, StdinFormat, FramingFormat, paramBuilder)) {
TParams params = paramBuilder->Build();
@@ -531,6 +531,8 @@ int TCommandExecuteQuery::ExecuteScanQuery(TConfig& config) {
NTable::TAsyncScanQueryPartIterator asyncResult;
SetInterruptHandlers();
if (!Parameters.empty() || !IsStdinInteractive()) {
+ ValidateResult = MakeHolder<NScripting::TExplainYqlResult>(
+ ExplainQuery(config, Query, NScripting::ExplainYqlRequestMode::Validate));
THolder<TParamsBuilder> paramBuilder;
while (GetNextParams(ValidateResult->GetParameterTypes(), InputFormat, StdinFormat, FramingFormat, paramBuilder)) {
auto operation = [this, &paramBuilder, &settings, &asyncResult](NTable::TTableClient client) {
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_yql.cpp b/ydb/public/lib/ydb_cli/commands/ydb_yql.cpp
index b1b3f712efe..c09188a485b 100644
--- a/ydb/public/lib/ydb_cli/commands/ydb_yql.cpp
+++ b/ydb/public/lib/ydb_cli/commands/ydb_yql.cpp
@@ -74,10 +74,6 @@ void TCommandYql::Parse(TConfig& config) {
if (ScriptFile) {
Script = ReadFromFile(ScriptFile, "script");
}
- if (!Interactive) {
- ValidateResult = MakeHolder<NScripting::TExplainYqlResult>(
- ExplainQuery(config, Script, NScripting::ExplainYqlRequestMode::Validate));
- }
ParseParameters(config);
}
@@ -143,6 +139,8 @@ int TCommandYql::RunCommand(TConfig& config, const TString &script) {
}
if (!Parameters.empty() || !IsStdinInteractive()) {
+ ValidateResult = MakeHolder<NScripting::TExplainYqlResult>(
+ ExplainQuery(config, Script, NScripting::ExplainYqlRequestMode::Validate));
THolder<TParamsBuilder> paramBuilder;
while (!IsInterrupted() &&
GetNextParams(ValidateResult->GetParameterTypes(), InputFormat, StdinFormat, FramingFormat, paramBuilder)) {