Skip to content
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

Fix panic of empty value in filter config #799

Merged
merged 4 commits into from
Nov 11, 2019

Conversation

july2993
Copy link
Contributor

@july2993 july2993 commented Nov 7, 2019

What problem does this PR solve?

Fix panic of empty value in filter config
Verify config about filters

What is changed and how it works?

Fix panic of empty value in filter config
Verify config about filters

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

  • Need to be included in the release note

@july2993 july2993 requested review from suzaku and zier-one November 7, 2019 06:54
re = regexp.MustCompile(fmt.Sprintf("(?i)%s", originStr[1:]))
} else { // must match completely
re = regexp.MustCompile(fmt.Sprintf("(?i)^%s$", originStr))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If originStr is empty, the regex become ^$?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the else case means you must match totally.
but we check the config for empty schema and table at startup time, so it will not run into this case now actually, because it's meaningless for an empty schema and table, may cause by misconfiguring.

@july2993
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@zier-one zier-one left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@suzaku suzaku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sre-bot
Copy link

sre-bot commented Nov 11, 2019

cherry pick to release-3.1 in PR #800

@sre-bot
Copy link

sre-bot commented Nov 11, 2019

cherry pick to release-2.1 failed

@sre-bot
Copy link

sre-bot commented Nov 11, 2019

cherry pick to release-3.0 in PR #801

july2993 added a commit to july2993/tidb-binlog that referenced this pull request Nov 11, 2019
Fix panic of empty value in filter config
Verify config about filters with empty schema or table name.
july2993 added a commit that referenced this pull request Nov 13, 2019
Fix panic of empty value in filter config
Verify config about filters with empty schema or table name.
@july2993 july2993 deleted the fix_panic_of_empty branch November 14, 2019 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants