Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
cbade51
add function of get term field's value by field name
Apr 8, 2017
1a3b997
change field to column
WangXiangUSTC Apr 9, 2017
06a1322
Update rows.go
WangXiangUSTC Apr 9, 2017
bbed0d6
Merge remote-tracking branch 'remotesrc/master'
Apr 19, 2017
525eb21
add function to set dump charset
Apr 19, 2017
fddc322
add set of charcter
Apr 26, 2017
10f2f26
add config of mysql charset
Apr 30, 2017
8f5f42f
Update canal.go
WangXiangUSTC Apr 30, 2017
568899f
Update config.go
WangXiangUSTC Apr 30, 2017
1c2b0a6
Update config.go
WangXiangUSTC May 1, 2017
d41eb60
remove comment
WangXiangUSTC May 4, 2017
c342f9c
Update dump_test.go
WangXiangUSTC May 4, 2017
acf0521
Update config.go
WangXiangUSTC May 4, 2017
1652936
remove unused code
WangXiangUSTC May 4, 2017
c7792f5
update go-mysql version
WangXiangUSTC May 5, 2017
f444682
merge from remote master
Jul 22, 2017
09168b9
fix a bug
WangXiangUSTC Jul 22, 2017
d90ee86
if use gtid sync, use gtid when retry
Jul 22, 2017
6582b7c
modify code
Jul 22, 2017
1e4c520
fix bug
Jul 23, 2017
011e9d0
fix bug
Jul 23, 2017
7a894fe
Update binlogsyncer.go
WangXiangUSTC Jul 23, 2017
489a5e9
Update config.go
WangXiangUSTC Jul 23, 2017
b646916
Update config.go
WangXiangUSTC Jul 23, 2017
ab8fee0
Update dump.go
WangXiangUSTC Jul 23, 2017
e5b7164
Update glide.lock
WangXiangUSTC Jul 23, 2017
89d8714
Update mariadb_gtid.go
WangXiangUSTC Jul 24, 2017
9d183be
change if else to switch
Jul 24, 2017
55f10a0
change updategtidset to update
Jul 27, 2017
eb4c160
add gtid set information in xid event
Jul 30, 2017
bddcc7f
merge remote src
Jul 30, 2017
ddd4ee6
Update binlogsyncer.go
WangXiangUSTC Jul 31, 2017
b3f2817
Update event.go
WangXiangUSTC Jul 31, 2017
b72a2bc
Merge remote-tracking branch 'remote_src/master'
Aug 1, 2017
c5d3464
add gtid set information in query event
Aug 1, 2017
5c0846d
add gtid set information in query event
Aug 1, 2017
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add config of mysql charset
  • Loading branch information
WangXiangUSTC committed Apr 30, 2017
commit 10f2f26c55fa548666455af3d67948aab7f0dcce
9 changes: 5 additions & 4 deletions canal/canal.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (c *Canal) prepareDumper() error {

charset := c.cfg.Charset
if len(charset) == 0 {
c.dumper.SetCharset(DEFAULT_CHARSET)
c.dumper.SetCharset(mysql.DEFAULT_CHARSET)
}else {
c.dumper.SetCharset(charset)
}
Expand Down Expand Up @@ -273,13 +273,14 @@ func (c *Canal) prepareSyncer() error {
Port: uint16(port),
User: c.cfg.User,
Password: c.cfg.Password,
Charset : c.cfg.Charset,
}

c.syncer = replication.NewBinlogSyncer(&cfg)

if len(c.cfg.Charset) != 0 {
c.syncer.c.setCharset(c.cfg.Charset)
}
//if len(c.cfg.Charset) != 0 {
// c.syncer.c.setCharset(c.cfg.Charset)
//}

return nil
}
Expand Down
6 changes: 6 additions & 0 deletions replication/binlogsyncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ type BinlogSyncerConfig struct {
// If not set, use os.Hostname() instead.
Localhost string

// Charset is for MySQL client character set
Charset string

// SemiSyncEnabled enables semi-sync or not.
SemiSyncEnabled bool

Expand Down Expand Up @@ -143,6 +146,9 @@ func (b *BinlogSyncer) registerSlave() error {
if err != nil {
return errors.Trace(err)
}
if len(b.cfg.Charset) != 0 {
b.c.SetCharset(b.cfg.Charset)
}

//for mysql 5.6+, binlog has a crc32 checksum
//before mysql 5.6, this will not work, don't matter.:-)
Expand Down