Skip to content

Commit fdd11a6

Browse files
committed
Remove unneeded log on SP
1 parent e95e5cd commit fdd11a6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

canal/sync.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package canal
22

33
import (
44
"fmt"
5+
"strings"
56
"sync/atomic"
67
"time"
78

@@ -142,7 +143,15 @@ func (c *Canal) runSyncBinlog() error {
142143
case *replication.QueryEvent:
143144
stmts, _, err := c.parser.Parse(string(e.Query), "", "")
144145
if err != nil {
145-
log.Errorf("parse query(%s) err %v, will skip this event", e.Query, err)
146+
msg := err.Error()
147+
if strings.Contains(strings.ToLower(msg), strings.ToLower("procedure")) {
148+
// Cut the first row from the message since it contain the procedure call and not the entire message
149+
fl := strings.Split(msg, "\n")
150+
log.Errorf("parse SP Error: (%s)", fl[0])
151+
} else {
152+
log.Errorf("parse query(%s) err %v", e.Query, err)
153+
}
154+
log.Error("will skip this event")
146155
continue
147156
}
148157
for _, stmt := range stmts {

0 commit comments

Comments
 (0)