File tree 3 files changed +17
-3
lines changed
ydb/core/kqp/session_actor
3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,12 @@ bool TKqpQueryState::SaveAndCheckCompileResult(TEvKqp::TEvCompileResponse* ev) {
159
159
if (!CommandTagName) {
160
160
CommandTagName = CompileResult->CommandTagName ;
161
161
}
162
+ for (const auto & param : PreparedQuery->GetParameters ()) {
163
+ const auto & ast = CompileResult->Ast ;
164
+ if (!ast || !ast->PgAutoParamValues || !ast->PgAutoParamValues ->contains (param.GetName ())) {
165
+ ResultParams.push_back (param);
166
+ }
167
+ }
162
168
return true ;
163
169
}
164
170
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ class TKqpQueryState : public TNonCopyable {
103
103
ui64 ParametersSize = 0 ;
104
104
TPreparedQueryHolder::TConstPtr PreparedQuery;
105
105
TKqpCompileResult::TConstPtr CompileResult;
106
+ TVector<NKikimrKqp::TParameterDescription> ResultParams;
106
107
TKqpStatsCompile CompileStats;
107
108
TIntrusivePtr<TKqpTransactionContext> TxCtx;
108
109
TQueryData::TPtr QueryData;
@@ -188,6 +189,10 @@ class TKqpQueryState : public TNonCopyable {
188
189
return QueryParameterTypes;
189
190
}
190
191
192
+ TVector<NKikimrKqp::TParameterDescription> GetResultParams () const {
193
+ return ResultParams;
194
+ }
195
+
191
196
void EnsureAction () {
192
197
YQL_ENSURE (RequestEv->HasAction ());
193
198
}
Original file line number Diff line number Diff line change @@ -1697,8 +1697,9 @@ class TKqpSessionActor : public TActorBootstrapped<TKqpSessionActor> {
1697
1697
1698
1698
if (replyQueryParameters) {
1699
1699
YQL_ENSURE (QueryState->PreparedQuery );
1700
- response->MutableQueryParameters ()->CopyFrom (
1701
- QueryState->PreparedQuery ->GetParameters ());
1700
+ for (auto & param : QueryState->GetResultParams ()) {
1701
+ *response->AddQueryParameters () = param;
1702
+ }
1702
1703
}
1703
1704
1704
1705
if (replyQueryId) {
@@ -1902,7 +1903,9 @@ class TKqpSessionActor : public TActorBootstrapped<TKqpSessionActor> {
1902
1903
response.SetPreparedQuery (compileResult->Uid );
1903
1904
1904
1905
auto & preparedQuery = compileResult->PreparedQuery ;
1905
- response.MutableQueryParameters ()->CopyFrom (preparedQuery->GetParameters ());
1906
+ for (auto & param : QueryState->GetResultParams ()) {
1907
+ *response.AddQueryParameters () = param;
1908
+ }
1906
1909
1907
1910
response.SetQueryPlan (preparedQuery->GetPhysicalQuery ().GetQueryPlan ());
1908
1911
response.SetQueryAst (preparedQuery->GetPhysicalQuery ().GetQueryAst ());
You can’t perform that action at this time.
0 commit comments