From 9c32006f2a3c213570202a2024b464e850c37df4 Mon Sep 17 00:00:00 2001 From: Rulin Tang Date: Sun, 3 Mar 2024 16:42:21 +0800 Subject: [PATCH] handle error for xa exec context --- pkg/datasource/sql/conn_xa.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/datasource/sql/conn_xa.go b/pkg/datasource/sql/conn_xa.go index f557c1e24..52e0da570 100644 --- a/pkg/datasource/sql/conn_xa.go +++ b/pkg/datasource/sql/conn_xa.go @@ -102,7 +102,11 @@ func (c *XAConn) ExecContext(ctx context.Context, query string, args []driver.Na return types.NewResult(types.WithResult(ret)), nil }) - return ret.GetResult(), err + if err != nil { + return nil, err + } + + return ret.GetResult(), nil } // BeginTx like common transaction. but it just exec XA START