Skip to content

Commit 4812526

Browse files
authored
Bug fix (#28)
* Update version * Fixed that collation condition checking * Modified that mysql connection settings
1 parent 887fe45 commit 4812526

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

builder/builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func willAlterColumnCharacterSet(old, new *mysql.Table) []string {
7777
}
7878
newCol := newCols[colName]
7979
oldCol := oldCols[colName]
80-
if newCol.CharacterSetName.Valid && oldCol.CompareCharacterSet(newCol) {
80+
if !newCol.CharacterSetName.Valid || oldCol.CompareCharacterSet(newCol) {
8181
continue
8282
}
8383
oldCols[colName].CollationName = newCol.CollationName

cmd/carpenter/command/before.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package command
22

33
import (
44
"database/sql"
5+
"time"
56

67
"fmt"
78

@@ -30,6 +31,8 @@ func Before(c *cli.Context) error {
3031
if err != nil {
3132
return fmt.Errorf("err: db.Open is failed for reason %v", err)
3233
}
34+
db.SetMaxIdleConns(0)
3335
db.SetMaxOpenConns(8)
36+
db.SetConnMaxLifetime(time.Minute)
3437
return nil
3538
}

0 commit comments

Comments
 (0)