slievrly commented on code in PR #989:
URL:
https://github.com/apache/incubator-seata-go/pull/989#discussion_r2508111298
##########
pkg/datasource/sql/undo/base/undo.go:
##########
@@ -421,14 +421,16 @@ func (m *BaseUndoLogManager) DBType() types.DBType {
// HasUndoLogTable check undo log table if exist
func (m *BaseUndoLogManager) HasUndoLogTable(ctx context.Context, conn
*sql.Conn) (res bool, err error) {
- if _, err = conn.QueryContext(ctx, getCheckUndoLogTableExistSql()); err
!= nil { //nolint:rowserrcheck,sqlclosecheck
+ rows, err := conn.QueryContext(ctx, getCheckUndoLogTableExistSql())
+ if err != nil {
// 1146 mysql table not exist fault code
if e, ok := err.(*mysql.SQLError); ok && e.Code ==
mysql.ErrNoSuchTable {
return false, nil
}
log.Errorf("[HasUndoLogTable] query sql fail, err: %v", err)
- return
+ return false, err
}
+ defer rows.Close()
Review Comment:
if rows != nil {
defer rows.Close()
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]