Skip to content

Commit

Permalink
filter (ticdc): add unit test case to cover all event type for event …
Browse files Browse the repository at this point in the history
…filter (#10708)

ref #10511
  • Loading branch information
asddongmen authored Mar 6, 2024
1 parent 8c51dfa commit e5edb19
Show file tree
Hide file tree
Showing 4 changed files with 223 additions and 137 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ require (
github.com/pingcap/log v1.1.1-0.20230317032135-a0d097d16e22
github.com/pingcap/tidb v1.1.0-beta.0.20240228123331-27ce02afd2e3
github.com/pingcap/tidb-dashboard v0.0.0-20240127080020-2171c6e6b9d7
github.com/pingcap/tidb-tools v0.0.0-20240202030925-a6014db89eb8
github.com/pingcap/tidb-tools v0.0.0-20240305021104-9f9bea84490b
github.com/pingcap/tidb/pkg/parser v0.0.0-20240228123331-27ce02afd2e3
github.com/prometheus/client_golang v1.18.0
github.com/prometheus/client_model v0.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,8 @@ github.com/pingcap/tidb v1.1.0-beta.0.20240228123331-27ce02afd2e3 h1:vLUU7S6yhHe
github.com/pingcap/tidb v1.1.0-beta.0.20240228123331-27ce02afd2e3/go.mod h1:pwZI+N72Xb+2KsEragMzRmb4EEUFSbrOS0mMcaHMFCM=
github.com/pingcap/tidb-dashboard v0.0.0-20240127080020-2171c6e6b9d7 h1:M+kqgNnOnzjRb5NubF7QFhyDeQKYcgtLHB12gzYPoUk=
github.com/pingcap/tidb-dashboard v0.0.0-20240127080020-2171c6e6b9d7/go.mod h1:ucZBRz52icb23T/5Z4CsuUHmarYiin7p2MeiVBe+o8c=
github.com/pingcap/tidb-tools v0.0.0-20240202030925-a6014db89eb8 h1:oJVvhhIpYrBxiIPUC2M9mXZw4M7EdX8DBiac35YCXzs=
github.com/pingcap/tidb-tools v0.0.0-20240202030925-a6014db89eb8/go.mod h1:FupVn04P2/dkvzK4Tt5URj5z2Y4ILcULw7dU3GnJXgQ=
github.com/pingcap/tidb-tools v0.0.0-20240305021104-9f9bea84490b h1:UC4lLT2OBHGImFJbiXQfIxIck7AoFLIiRJ6Eo6uFVaw=
github.com/pingcap/tidb-tools v0.0.0-20240305021104-9f9bea84490b/go.mod h1:FupVn04P2/dkvzK4Tt5URj5z2Y4ILcULw7dU3GnJXgQ=
github.com/pingcap/tidb/pkg/parser v0.0.0-20240228123331-27ce02afd2e3 h1:YF17teH7c/WKeIc6MO8gEKiNe25X36nKxxtPPwO+/O0=
github.com/pingcap/tidb/pkg/parser v0.0.0-20240228123331-27ce02afd2e3/go.mod h1:MWQK6otJgZRI6zcCVPV22U4qE26qOGJnN4fq8XawgBs=
github.com/pingcap/tipb v0.0.0-20240116032918-9bb28c43bbfc h1:sEp4lbExDfnMX8HXQyhZrhqo2/SgeFY5KOdo5akc8FM=
Expand Down
2 changes: 1 addition & 1 deletion pkg/filter/sql_event_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (f *sqlEventFilter) getRules(schema, table string) []*sqlEventRule {
}

// skipDDLEvent skips ddl event by its type and query.
func (f *sqlEventFilter) shouldSkipDDL(ddl *model.DDLEvent) (bool, error) {
func (f *sqlEventFilter) shouldSkipDDL(ddl *model.DDLEvent) (skip bool, err error) {
if len(f.rules) == 0 {
return false, nil
}
Expand Down
Loading

0 comments on commit e5edb19

Please sign in to comment.