Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion canal/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package canal

import (
"fmt"
"strings"
"sync/atomic"
"time"

Expand Down Expand Up @@ -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")) {
// Cut the first row from the message since it contain the procedure call and not the entire message
fl := strings.Split(msg, "\n")
log.Errorf("parse SP Error: (%s)", fl[0])
} else {
log.Errorf("parse query(%s) err %v", e.Query, err)
}
log.Error("will skip this event")
continue
}
for _, stmt := range stmts {
Expand Down