Skip to content

Commit

Permalink
test: add plan test
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <manan@planetscale.com>
  • Loading branch information
GuptaManan100 committed Aug 13, 2024
1 parent baa2b3a commit 05a453c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go/vt/vtgate/engine/transaction_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
23 changes: 23 additions & 0 deletions go/vt/vtgate/planbuilder/testdata/show_cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
]

0 comments on commit 05a453c

Please sign in to comment.