From b0e1fd673932604cf7b9ba9055ede366c3949651 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Fri, 27 Dec 2024 08:59:34 +0100 Subject: [PATCH] fix: typo in function (#5456) --- pkg/meta/sql.go | 6 +++--- pkg/meta/sql_mysql.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/meta/sql.go b/pkg/meta/sql.go index 8d5c929bceff..32322774a38b 100644 --- a/pkg/meta/sql.go +++ b/pkg/meta/sql.go @@ -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 @@ -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 } } diff --git a/pkg/meta/sql_mysql.go b/pkg/meta/sql_mysql.go index 923cd855d908..6f7f63911ded 100644 --- a/pkg/meta/sql_mysql.go +++ b/pkg/meta/sql_mysql.go @@ -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 @@ -44,6 +44,6 @@ func setMySQLTransationIsolation(dns string) (string, error) { func init() { dupErrorCheckers = append(dupErrorCheckers, isMySQLDuplicateEntryErr) - setTransationIsolation = setMySQLTransationIsolation + setTransactionIsolation = setMySQLTransactionIsolation Register("mysql", newSQLMeta) }