Skip to content

Commit

Permalink
fix(mysql): Replace the deprecated system variable tx_isolation in My…
Browse files Browse the repository at this point in the history
…SQL 8.0
  • Loading branch information
SihangYu committed Oct 3, 2024
1 parent a76ce32 commit a8ac412
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ func schedExists(tx *sql.Tx, date time.Time) (result bool, err error) {
// See: https://github.com/go-sql-driver/mysql#dsn-data-source-name
func dsn(host string, port int, user string, password string, dbname string) string {
params := map[string]string{
"tx_isolation": "SERIALIZABLE", // we need serializable transactions for atomic test & set behavior
"parseTime": "true", // enable us to use sql.Rows.Scan to read time.Time objects from queries
"loc": "UTC", // Scan'd time.Times should be treated as being in UTC time zone
"time_zone": "UTC", // MySQL should interpret DATETIME values as being in UTC
"transaction_isolation": "SERIALIZABLE", // we need serializable transactions for atomic test & set behavior
"parseTime": "true", // enable us to use sql.Rows.Scan to read time.Time objects from queries
"loc": "UTC", // Scan'd time.Times should be treated as being in UTC time zone
"time_zone": "UTC", // MySQL should interpret DATETIME values as being in UTC
}

var ss []string
Expand Down

0 comments on commit a8ac412

Please sign in to comment.