Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
syncer: support case insensitive binlog event in filter (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
amyangfei authored Jun 26, 2019
1 parent a07722d commit 0ba5300
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/pingcap/parser v0.0.0-20190613082312-d2cf6071823d
github.com/pingcap/pd v2.1.12+incompatible // indirect
github.com/pingcap/tidb v0.0.0-20190613131440-c59a108c28b7
github.com/pingcap/tidb-tools v3.0.0-beta.1.0.20190522080351-b06622ae57fd+incompatible
github.com/pingcap/tidb-tools v3.0.0-beta.1.0.20190626065910-16523947c844+incompatible
github.com/prometheus/client_golang v0.9.4
github.com/prometheus/common v0.4.1
github.com/remyoudompheng/bigfft v0.0.0-20190512091148-babf20351dd7 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ github.com/pingcap/pd v2.1.12+incompatible/go.mod h1:nD3+EoYes4+aNNODO99ES59V83M
github.com/pingcap/tidb v0.0.0-20190613131440-c59a108c28b7 h1:WzzifUZ1nRsZMijRrLznb2TKh6JYGi/9pgvVT7mnl2w=
github.com/pingcap/tidb v0.0.0-20190613131440-c59a108c28b7/go.mod h1:c4qUUwEF9VSWePAPB7qFEVdaytJBcc2Tf/yuKKhCErA=
github.com/pingcap/tidb-tools v2.1.3-0.20190321065848-1e8b48f5c168+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM=
github.com/pingcap/tidb-tools v3.0.0-beta.1.0.20190522080351-b06622ae57fd+incompatible h1:87HclE+yA7xYE3VhMZh+PPT541ZHqB6WiFKOgK3C/4w=
github.com/pingcap/tidb-tools v3.0.0-beta.1.0.20190522080351-b06622ae57fd+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM=
github.com/pingcap/tidb-tools v3.0.0-beta.1.0.20190626065910-16523947c844+incompatible h1:kiYtLakPd2GKNHiYnfa6XCNRoRLRLndavuGhA7kBslA=
github.com/pingcap/tidb-tools v3.0.0-beta.1.0.20190626065910-16523947c844+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM=
github.com/pingcap/tipb v0.0.0-20190428032612-535e1abaa330 h1:rRMLMjIMFulCX9sGKZ1hoov/iROMsKyC8Snc02nSukw=
github.com/pingcap/tipb v0.0.0-20190428032612-535e1abaa330/go.mod h1:RtkHW8WbcNxj8lsbzjaILci01CtYnYbIkQhjyZWrWVI=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
10 changes: 10 additions & 0 deletions syncer/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"context"
"database/sql"
"fmt"
"strings"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -514,6 +515,11 @@ func (s *testSyncerSuite) TestSkipDML(c *C) {
TablePattern: "bar1",
Events: []bf.EventType{bf.DeleteEvent},
Action: bf.Ignore,
}, {
SchemaPattern: "foo1",
TablePattern: "bar2",
Events: []bf.EventType{bf.EventType(strings.ToUpper(string(bf.DeleteEvent)))},
Action: bf.Ignore,
},
}
s.cfg.BWList = nil
Expand All @@ -535,6 +541,10 @@ func (s *testSyncerSuite) TestSkipDML(c *C) {
{"insert into foo1.bar1 values(1)", true, false},
{"update foo1.bar1 set id=2", true, true},
{"delete from foo1.bar1 where id=2", true, true},
{"create table foo1.bar2(id int)", false, false},
{"insert into foo1.bar2 values(1)", true, false},
{"update foo1.bar2 set id=2", true, true},
{"delete from foo1.bar2 where id=2", true, true},
}

for i := range sqls {
Expand Down

0 comments on commit 0ba5300

Please sign in to comment.