- Notifications
You must be signed in to change notification settings - Fork 1k
Fix: charset latin1 #1036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sigalikanevsky wants to merge 41 commits into go-mysql-org:master Choose a base branch from RiveryIO:fix/charset_latin1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Open
Fix: charset latin1 #1036
Changes from 1 commit
Commits
Show all changes
41 commits Select commit Hold shift + click to select a range
ef55c4c Added waitTimeBetweenConnection check
eitamring 6855741 Added safe conn close
eitamring e6565cd Added file name to each event
eitamring cb4f084 Added gtid to each event
eitamring 8d7d13c Removed FlushBinlog which was only used for testing
eitamring f81397d Fixed testing
eitamring f77308e Merge pull request #1 from RiveryIO/feature/eitam/removed_flush_for_t…
eitamring 824d650 Added delete on table when deleted
eitamring 61a148b probably grammar
eitamring 8cc642f Merge pull request #2 from RiveryIO/fix/eitam/add_skip_when_table_is_…
eitamring 05b87bb Removed spamming log
eitamring 2025086 Merge pull request #3 from RiveryIO/feature/eitam/removed_spaming_log
eitamring fa2e8fa Added covert to string interface if needed
eitamring e95e5cd Merge pull request #4 from RiveryIO/feature/eitam/support_base64_byte…
eitamring fdd11a6 Remove unneeded log on SP
eitamring d947c9e Merge pull request #5 from RiveryIO/feautre/eitam/remove_uneeded_log_…
eitamring 73477d3 Change mysql_date default zero based value to nil
eitamring eb2ea8e Merge pull request #6 from RiveryIO/feature/eitam/add_nil_based_value…
eitamring 007d419 Change mysql_MYSQL_TYPE_TIMESTAMP2 and MYSQL_TYPE_TIMESTAMP to be def…
eitamring c6c9248 Merge pull request #7 from RiveryIO/feature/eitam/add_nil_based_value…
eitamring d15a7ce Change decodeDatetime2 default to zero
eitamring 4298599 Merge pull request #8 from RiveryIO/feature/eitam/add_nil_based_value…
eitamring 1f7d701 Change decodeTimestamp2 to return nil in case sec = 0
eitamring 98108dd Merge pull request #9 from RiveryIO/fix/eitam/decode_timestamp
eitamring 411b75d Add limit to max host name length
eitamring 9bd5965 Merge pull request #10 from RiveryIO/feature/eitam/limit_max_host_name
eitamring c349655 Change log debug level
eitamring e7d51c3 Merge pull request #12 from RiveryIO/feature/eitam/change_log_debug_s…
eitamring c3593a7 add latin support
sigalikanevsky fd2c582 add latin support
sigalikanevsky 3d213ae add latin support
sigalikanevsky b34a98d add latin support
sigalikanevsky 7222b87 add latin support
sigalikanevsky b4851e0 add latin support
sigalikanevsky b939f18 move to function
sigalikanevsky 88f0609 move to function
sigalikanevsky 0799a57 fixes and tests
sigalikanevsky a2053cd fixes
sigalikanevsky 818807e Merge pull request #13 from RiveryIO/bugfix/DEV-13143
sigalikanevsky e614dda Add tests for latin1 decoding. Currently failing. Needs to align code
aaronabv 5a76553 add utf8 chars
sigalikanevsky 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
Next Next commit
Added waitTimeBetweenConnection check
- Loading branch information
commit ef55c4cc8984efaff6f56756043324a9d7831b4d
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| | @@ -28,6 +28,9 @@ type BinlogSyncerConfig struct { | |||||
| // Flavor is "mysql" or "mariadb", if not set, use "mysql" default. | ||||||
| Flavor string | ||||||
| | ||||||
| // MaxWaitTimeBetween Check connection | ||||||
| WaitTimeBetweenConnectionSeconds time.Duration | ||||||
| | ||||||
| // Host is for MySQL server host. | ||||||
| Host string | ||||||
| // Port is for MySQL server port. | ||||||
| | @@ -145,7 +148,7 @@ func NewBinlogSyncer(cfg BinlogSyncerConfig) *BinlogSyncer { | |||||
| // Clear the Password to avoid outputing it in log. | ||||||
| pass := cfg.Password | ||||||
| cfg.Password = "" | ||||||
| log.Infof("create BinlogSyncer with config %v", cfg) | ||||||
| log.Debugf("create BinlogSyncer with config %v", cfg) | ||||||
| cfg.Password = pass | ||||||
| | ||||||
| b := new(BinlogSyncer) | ||||||
| | @@ -177,7 +180,7 @@ func (b *BinlogSyncer) close() { | |||||
| return | ||||||
| } | ||||||
| | ||||||
| log.Info("syncer is closing...") | ||||||
| log.Debug("syncer is closing...") | ||||||
| | ||||||
| b.running = false | ||||||
| b.cancel() | ||||||
| | @@ -207,7 +210,7 @@ func (b *BinlogSyncer) close() { | |||||
| b.c.Close() | ||||||
| } | ||||||
| | ||||||
| log.Info("syncer is closed") | ||||||
| log.Debug("syncer is closed") | ||||||
| } | ||||||
| | ||||||
| func (b *BinlogSyncer) isClosed() bool { | ||||||
| | @@ -371,7 +374,7 @@ func (b *BinlogSyncer) GetNextPosition() Position { | |||||
| | ||||||
| // StartSync starts syncing from the `pos` position. | ||||||
| func (b *BinlogSyncer) StartSync(pos Position) (*BinlogStreamer, error) { | ||||||
| log.Infof("begin to sync binlog from position %s", pos) | ||||||
| log.Debugf("begin to sync binlog from position %s", pos) | ||||||
| | ||||||
| b.m.Lock() | ||||||
| defer b.m.Unlock() | ||||||
| | @@ -389,7 +392,7 @@ func (b *BinlogSyncer) StartSync(pos Position) (*BinlogStreamer, error) { | |||||
| | ||||||
| // StartSyncGTID starts syncing from the `gset` GTIDSet. | ||||||
| func (b *BinlogSyncer) StartSyncGTID(gset GTIDSet) (*BinlogStreamer, error) { | ||||||
| log.Infof("begin to sync binlog from GTID set %s", gset) | ||||||
| log.Debugf("begin to sync binlog from GTID set %s", gset) | ||||||
| | ||||||
| b.prevGset = gset | ||||||
| | ||||||
| | @@ -593,13 +596,13 @@ func (b *BinlogSyncer) retrySync() error { | |||||
| if b.currGset != nil { | ||||||
| msg = fmt.Sprintf("%v (last read GTID=%v)", msg, b.currGset) | ||||||
| } | ||||||
| log.Infof(msg) | ||||||
| log.Debugf(msg) | ||||||
| | ||||||
| if err := b.prepareSyncGTID(b.prevGset); err != nil { | ||||||
| return errors.Trace(err) | ||||||
| } | ||||||
| } else { | ||||||
| log.Infof("begin to re-sync from %s", b.nextPos) | ||||||
| log.Debugf("begin to re-sync from %s", b.nextPos) | ||||||
| if err := b.prepareSyncPos(b.nextPos); err != nil { | ||||||
| return errors.Trace(err) | ||||||
| } | ||||||
| | @@ -684,6 +687,7 @@ func (b *BinlogSyncer) onStream(s *BinlogStreamer) { | |||||
| } | ||||||
| | ||||||
| for { | ||||||
| // Read packet until CTX is done if not will continue after the loop | ||||||
| select { | ||||||
| case <-b.ctx.Done(): | ||||||
| s.close() | ||||||
| | @@ -697,7 +701,8 @@ func (b *BinlogSyncer) onStream(s *BinlogStreamer) { | |||||
| return | ||||||
| } | ||||||
| | ||||||
| log.Errorf("retry sync err: %v, wait 1s and retry again", err) | ||||||
| log.Errorf("retry sync err: %v, wait %s s and retry again", err, b.cfg.WaitTimeBetweenConnectionSeconds) | ||||||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested change
| ||||||
| time.Sleep(b.cfg.WaitTimeBetweenConnectionSeconds) | ||||||
| continue | ||||||
| } | ||||||
| } | ||||||
| | @@ -731,7 +736,7 @@ func (b *BinlogSyncer) onStream(s *BinlogStreamer) { | |||||
| // refer to https://dev.mysql.com/doc/internals/en/com-binlog-dump.html#binlog-dump-non-block | ||||||
| // when COM_BINLOG_DUMP command use BINLOG_DUMP_NON_BLOCK flag, | ||||||
| // if there is no more event to send an EOF_Packet instead of blocking the connection | ||||||
| log.Info("receive EOF packet, no more binlog event now.") | ||||||
| log.Debug("receive EOF packet, no more binlog event now.") | ||||||
| continue | ||||||
| default: | ||||||
| log.Errorf("invalid stream header %c", data[0]) | ||||||
| | @@ -787,7 +792,7 @@ func (b *BinlogSyncer) parseEvent(s *BinlogStreamer, data []byte) error { | |||||
| case *RotateEvent: | ||||||
| b.nextPos.Name = string(event.NextLogName) | ||||||
| b.nextPos.Pos = uint32(event.Position) | ||||||
| log.Infof("rotate to %s", b.nextPos) | ||||||
| log.Debugf("rotate to %s", b.nextPos) | ||||||
| case *GTIDEvent: | ||||||
| if b.prevGset == nil { | ||||||
| break | ||||||
| | @@ -860,5 +865,5 @@ func (b *BinlogSyncer) killConnection(conn *client.Conn, id uint32) { | |||||
| log.Error(errors.Trace(err)) | ||||||
| } | ||||||
| } | ||||||
| log.Infof("kill last connection id %d", id) | ||||||
| log.Debugf("kill last connection id %d", id) | ||||||
| } | ||||||
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems odd, why replace all configs with 5 seconds?