-
Notifications
You must be signed in to change notification settings - Fork 991
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
add support for createIndexStmt and dropIndexStmt #844
Conversation
This PR addresses the changes requested in #843 |
Would it be possible to add some tests? |
type MyEventHandler struct { func (h *MyEventHandler) OnDDL(header *replication.EventHeader, nextPos mysql.Position, queryEvent *replication.QueryEvent) error { cfg := canal.NewDefaultConfig() c.SetEventHandler(&MyEventHandler{}) i use this code to get ddl sql,but when i use |
|
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.
thanks for your PR. please check my comment and apply it for the DROP INDEX test cases
canal/canal_test.go
Outdated
for _, node := range nodes { | ||
rdb := node.db | ||
rtable := node.table | ||
if (len(rdb) != 0 && rdb != db) || rtable != baseTable { |
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.
and here, you can use require.Equal(t, db, rdb)
and require.Equal(t, baseTable, rtable)
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.
I have apply require package to test
fix create index indexName on tableName and drop index on DDL statment