diff --git a/canal/sync.go b/canal/sync.go index 27554c905..29226646d 100644 --- a/canal/sync.go +++ b/canal/sync.go @@ -2,6 +2,7 @@ package canal import ( "fmt" + "strings" "sync/atomic" "time" @@ -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 {