From 05a453c927cab5bd15704948900324dd2afd5c59 Mon Sep 17 00:00:00 2001 From: Manan Gupta Date: Tue, 13 Aug 2024 17:30:28 +0530 Subject: [PATCH] test: add plan test Signed-off-by: Manan Gupta --- go/vt/vtgate/engine/transaction_status.go | 2 +- .../planbuilder/testdata/show_cases.json | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/go/vt/vtgate/engine/transaction_status.go b/go/vt/vtgate/engine/transaction_status.go index c1e6ef96e9c..9914031009f 100644 --- a/go/vt/vtgate/engine/transaction_status.go +++ b/go/vt/vtgate/engine/transaction_status.go @@ -123,7 +123,7 @@ func (t *TransactionStatus) TryStreamExecute(ctx context.Context, vcursor VCurso func (t *TransactionStatus) description() PrimitiveDescription { otherMap := map[string]any{} if t.TransactionID == "" { - otherMap["AllUnresolved"] = t.Keyspace + otherMap["Keyspace"] = t.Keyspace } else { otherMap["TransactionID"] = t.TransactionID } diff --git a/go/vt/vtgate/planbuilder/testdata/show_cases.json b/go/vt/vtgate/planbuilder/testdata/show_cases.json index f7fbce608bc..00bd37fe8f2 100644 --- a/go/vt/vtgate/planbuilder/testdata/show_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/show_cases.json @@ -850,5 +850,28 @@ "TransactionID": "ks:-80:v24s7843sf78934l3" } } + }, + { + "comment": "show unresolved transactions for default keyspace", + "query": "show unresolved transactions", + "plan": { + "QueryType": "SHOW", + "Original": "show unresolved transactions", + "Instructions": { + "OperatorType": "TransactionStatus" + } + } + }, + { + "comment": "show unresolved transactions for explicitly provided keyspace", + "query": "show unresolved transactions for ks", + "plan": { + "QueryType": "SHOW", + "Original": "show unresolved transactions for ks", + "Instructions": { + "OperatorType": "TransactionStatus", + "Keyspace": "ks" + } + } } ]