-
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
base: master
Are you sure you want to change the base?
Fix: charset latin1 #1036
Conversation
…ests Removed FlushBinlog which was only used for testing
…deleted_while_reading Fix/eitam/add skip when table is deleted while reading
Feature/eitam/removed spamming log
…_decode Added support to convert byte to string dynamically
…on_sp Remove unneeded log on SP
…_to_date Change mysql_date default zero based value to nil
…_to_date Change mysql_MYSQL_TYPE_TIMESTAMP2 and MYSQL_TYPE_TIMESTAMP to be def…
…_to_date Change decodeDatetime2 default to zero
Change decodeTimestamp2 to return nil in case sec = 0
Add limit to max host name length
…p_log Changed SP is missing to debug level
feat: Charset parameter for Mysql connection [DEV-13143]
@sigalikanevsky There are merge conflicts that need to be fixed. This is also missing either a link to an issue or a good description about what this is fixing exactly. Is this only fixing |
@@ -65,6 +65,10 @@ func NewCanal(cfg *Config) (*Canal, error) { | |||
|
|||
c.ctx, c.cancel = context.WithCancel(context.Background()) | |||
|
|||
if cfg.WaitTimeBetweenConnectionSeconds > 0 { |
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?
@@ -142,7 +143,15 @@ func (c *Canal) runSyncBinlog() error { | |||
case *replication.QueryEvent: | |||
stmts, _, err := c.parser.Parse(string(e.Query), "", "") | |||
if err != nil { | |||
log.Errorf("parse query(%s) err %v, will skip this event", e.Query, err) | |||
msg := err.Error() | |||
if strings.Contains(strings.ToLower(msg), strings.ToLower("procedure")) { |
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.
if strings.Contains(strings.ToLower(msg), strings.ToLower("procedure")) { | |
if strings.Contains(strings.ToLower(msg), "procedure") { |
@@ -697,7 +707,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 comment
The reason will be displayed to describe this comment to others. Learn more.
log.Errorf("retry sync err: %v, wait %s s and retry again", err, b.cfg.WaitTimeBetweenConnectionSeconds) | |
log.Errorf("retry sync err: %v, wait %ss and retry again", err, b.cfg.WaitTimeBetweenConnectionSeconds) |
@@ -1182,6 +1220,33 @@ func decodeString(data []byte, length int) (v string, n int) { | |||
return | |||
} | |||
|
|||
// Replaces smart quotes with ASCII equivalents | |||
func replaceUnsupportedLatin1Characters(s string) string { | |||
s = string(bytes.ReplaceAll([]byte(s), []byte("‘"), []byte("'"))) |
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.
Should avoid repeatedly converting to/from string
@@ -1182,6 +1220,33 @@ func decodeString(data []byte, length int) (v string, n int) { | |||
return | |||
} | |||
|
|||
// Replaces smart quotes with ASCII equivalents | |||
func replaceUnsupportedLatin1Characters(s string) string { |
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.
func replaceUnsupportedLatin1Characters(s string) string { | |
func replaceUnsupportedLatin1Characters(s []byte) string { |
No description provided.