diff --git a/mblog/main.go b/mblog/main.go index a782c0a..427f99e 100644 --- a/mblog/main.go +++ b/mblog/main.go @@ -8,7 +8,6 @@ import ( "github.com/go-mysql-org/go-mysql/canal" "github.com/go-mysql-org/go-mysql/mysql" - "github.com/go-mysql-org/go-mysql/replication" ) // 自定义事件处理结构体 @@ -79,13 +78,13 @@ func (h *MyEventHandler) OnRow(e *canal.RowsEvent) error { } // 处理DDL事件 -func (h *MyEventHandler) OnDDL(nextPos mysql.Position, queryEvent *replication.QueryEvent) error { - sql := string(queryEvent.Query) - if sql != "" { - fmt.Println(sql + ";") - } - return nil -} +// func (h *MyEventHandler) OnDDL(nextPos mysql.Position, queryEvent *replication.QueryEvent) error { +// sql := string(queryEvent.Query) +// if sql != "" { +// fmt.Println(sql + ";") +// } +// return nil +// } // 格式化值为SQL表示形式 func formatValue(value interface{}) string { diff --git a/mblog/mblog b/mblog/mblog new file mode 100644 index 0000000..3df4a89 Binary files /dev/null and b/mblog/mblog differ