Skip to content

Commit 03f7fc8

Browse files
authored
parse binlog timestamp in UTC (#1322)
1 parent e664c1b commit 03f7fc8

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

go/binlog/gomysql_reader.go

+12-9
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"github.com/github/gh-ost/go/mysql"
1414
"github.com/github/gh-ost/go/sql"
1515

16+
"time"
17+
1618
gomysql "github.com/go-mysql-org/go-mysql/mysql"
1719
"github.com/go-mysql-org/go-mysql/replication"
1820
"golang.org/x/net/context"
@@ -36,15 +38,16 @@ func NewGoMySQLReader(migrationContext *base.MigrationContext) *GoMySQLReader {
3638
currentCoordinates: mysql.BinlogCoordinates{},
3739
currentCoordinatesMutex: &sync.Mutex{},
3840
binlogSyncer: replication.NewBinlogSyncer(replication.BinlogSyncerConfig{
39-
ServerID: uint32(migrationContext.ReplicaServerId),
40-
Flavor: gomysql.MySQLFlavor,
41-
Host: connectionConfig.Key.Hostname,
42-
Port: uint16(connectionConfig.Key.Port),
43-
User: connectionConfig.User,
44-
Password: connectionConfig.Password,
45-
TLSConfig: connectionConfig.TLSConfig(),
46-
UseDecimal: true,
47-
MaxReconnectAttempts: migrationContext.BinlogSyncerMaxReconnectAttempts,
41+
ServerID: uint32(migrationContext.ReplicaServerId),
42+
Flavor: gomysql.MySQLFlavor,
43+
Host: connectionConfig.Key.Hostname,
44+
Port: uint16(connectionConfig.Key.Port),
45+
User: connectionConfig.User,
46+
Password: connectionConfig.Password,
47+
TLSConfig: connectionConfig.TLSConfig(),
48+
UseDecimal: true,
49+
MaxReconnectAttempts: migrationContext.BinlogSyncerMaxReconnectAttempts,
50+
TimestampStringLocation: time.UTC,
4851
}),
4952
}
5053
}

0 commit comments

Comments
 (0)