Skip to content

Commit

Permalink
fix: typo in function (#5456)
Browse files Browse the repository at this point in the history
  • Loading branch information
solracsf authored Dec 27, 2024
1 parent 3d198ad commit b0e1fd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/meta/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func recoveryMysqlPwd(addr string) string {
return addr
}

var setTransationIsolation func(dns string) (string, error)
var setTransactionIsolation func(dns string) (string, error)

func newSQLMeta(driver, addr string, conf *Config) (Meta, error) {
var searchPath string
Expand All @@ -287,10 +287,10 @@ func newSQLMeta(driver, addr string, conf *Config) (Meta, error) {
}

// escaping is not necessary for mysql password https://github.com/go-sql-driver/mysql#password
if driver == "mysql" && setTransationIsolation != nil {
if driver == "mysql" && setTransactionIsolation != nil {
addr = recoveryMysqlPwd(addr)
var err error
if addr, err = setTransationIsolation(addr); err != nil {
if addr, err = setTransactionIsolation(addr); err != nil {
return nil, err
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/meta/sql_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func isMySQLDuplicateEntryErr(err error) bool {
return false
}

func setMySQLTransationIsolation(dns string) (string, error) {
func setMySQLTransactionIsolation(dns string) (string, error) {
cfg, err := mysql.ParseDSN(dns)
if err != nil {
return "", err
Expand All @@ -44,6 +44,6 @@ func setMySQLTransationIsolation(dns string) (string, error) {

func init() {
dupErrorCheckers = append(dupErrorCheckers, isMySQLDuplicateEntryErr)
setTransationIsolation = setMySQLTransationIsolation
setTransactionIsolation = setMySQLTransactionIsolation
Register("mysql", newSQLMeta)
}

0 comments on commit b0e1fd6

Please sign in to comment.