fix: mysql WithAcceptable bug (#3986)
This commit is contained in:
@@ -2,11 +2,11 @@ package sqlx
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/go-sql-driver/mysql"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/breaker"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/zeromicro/go-zero/core/stat"
|
||||
@@ -38,7 +38,6 @@ func TestBreakerOnNotHandlingDuplicateEntry(t *testing.T) {
|
||||
func TestMysqlAcceptable(t *testing.T) {
|
||||
conn := NewMysql("nomysql").(*commonSqlConn)
|
||||
withMysqlAcceptable()(conn)
|
||||
assert.EqualValues(t, reflect.ValueOf(mysqlAcceptable).Pointer(), reflect.ValueOf(conn.accept).Pointer())
|
||||
assert.True(t, mysqlAcceptable(nil))
|
||||
assert.False(t, mysqlAcceptable(errors.New("any")))
|
||||
assert.False(t, mysqlAcceptable(new(mysql.MySQLError)))
|
||||
|
||||
Reference in New Issue
Block a user