diff options
author | xenoxeno <[email protected]> | 2023-08-15 12:10:51 +0300 |
---|---|---|
committer | xenoxeno <[email protected]> | 2023-08-15 13:36:07 +0300 |
commit | 621fda51a62b159d046b3ca185238a9ccacb0c21 (patch) | |
tree | 2066676f43a03b522017ba93afa12dcd8d4dd5ab | |
parent | d90f268c68af2702de77fc5bf8a81923ca0ad8e2 (diff) |
fixing transaction status KIKIMR-18998
-rw-r--r-- | ydb/core/local_pgwire/pgwire_kqp_proxy.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ydb/core/local_pgwire/pgwire_kqp_proxy.cpp b/ydb/core/local_pgwire/pgwire_kqp_proxy.cpp index 6c9898c5479..c4b65cf170a 100644 --- a/ydb/core/local_pgwire/pgwire_kqp_proxy.cpp +++ b/ydb/core/local_pgwire/pgwire_kqp_proxy.cpp @@ -27,6 +27,7 @@ protected: std::unordered_map<TString, TString> ConnectionParams_; TConnectionState Connection_; TString Tag_; + NKikimrKqp::EQueryAction QueryAction_ = {}; TPgwireKqpProxy(const TActorId owner, std::unordered_map<TString, TString> params, const TConnectionState& connection) : Owner_(owner) @@ -115,6 +116,7 @@ protected: request.SetSyntax(Ydb::Query::SYNTAX_PG); request.SetQuery(TString(query)); } + QueryAction_ = request.GetAction(); } void ProcessKqpResponseReleaseProxy(const NKikimrKqp::TEvQueryResponse& record) { @@ -122,7 +124,7 @@ protected: if (record.GetYdbStatus() == Ydb::StatusIds::SUCCESS) { Connection_.Transaction.Id = record.GetResponse().GetTxMeta().id(); - if (Connection_.Transaction.Id) { + if (Connection_.Transaction.Id && QueryAction_ != NKikimrKqp::QUERY_ACTION_COMMIT_TX && QueryAction_ != NKikimrKqp::QUERY_ACTION_ROLLBACK_TX) { Connection_.Transaction.Status = 'T'; } else { Connection_.Transaction.Status = 'I'; @@ -295,7 +297,7 @@ public: // HACK ConvertQueryToRequest(QueryData_.Query, request); if (request.HasAction()) { - request.SetAction(NKikimrKqp::QUERY_ACTION_EXPLAIN); + request.SetAction(QueryAction_ = NKikimrKqp::QUERY_ACTION_EXPLAIN); request.SetUsePublicResponseDataFormat(true); |