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

sink: fix codec json encoding with non binary string #2764

Merged
merged 4 commits into from
Sep 9, 2021

Conversation

amyangfei
Copy link
Contributor

What problem does this PR solve?

Close #2758

Note we still don't known in which scenario the column value is string instead of []byte, need more investigation.

What is changed and how it works?

The column value type of mysql.TypeString, mysql.TypeVarString, mysql.TypeVarchar could be either string or []byte, we should consider both of these two types when converting a row column value to json encoding.

Check List

Tests

  • Unit test
  • Integration test

Release note

Fix json encoding could panic when processing a string type value in some cases.

@amyangfei amyangfei added type/bugfix This PR fixes a bug. needs-cherry-pick-release-4.0 Should cherry pick this PR to release-4.0 branch. needs-cherry-pick-release-5.0 Should cherry pick this PR to release-5.0 branch. needs-cherry-pick-release-5.1 Should cherry pick this PR to release-5.1 branch. needs-cherry-pick-release-5.2 Should cherry pick this PR to release-5.2 branch. labels Sep 7, 2021
@amyangfei amyangfei added this to the v5.3.0 milestone Sep 7, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 7, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • hi-rustin
  • overvenus

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Sep 7, 2021
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 7, 2021
@amyangfei
Copy link
Contributor Author

/run-all-tests /tikv=pr/10910

@amyangfei
Copy link
Contributor Author

/run-integration-tests /tikv=pr/10910

1 similar comment
@amyangfei
Copy link
Contributor Author

/run-integration-tests /tikv=pr/10910

@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2021

Codecov Report

Merging #2764 (8fd1cbf) into master (0ebf717) will increase coverage by 3.5061%.
The diff coverage is 74.3135%.

@@               Coverage Diff                @@
##             master      #2764        +/-   ##
================================================
+ Coverage   55.4760%   58.9821%   +3.5060%     
================================================
  Files           165        177        +12     
  Lines         19841      18136      -1705     
================================================
- Hits          11007      10697       -310     
+ Misses         7786       6478      -1308     
+ Partials       1048        961        -87     

@amyangfei amyangfei added the status/ptal Could you please take a look? label Sep 8, 2021
@amyangfei
Copy link
Contributor Author

/run-all-tests

@amyangfei
Copy link
Contributor Author

/run-leak-tests

@amyangfei
Copy link
Contributor Author

/run-integration-tests
/run-kafka-tests

@amyangfei
Copy link
Contributor Author

/run-integration-tests

2 similar comments
@amyangfei
Copy link
Contributor Author

/run-integration-tests

@amyangfei
Copy link
Contributor Author

/run-integration-tests

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 8, 2021
@overvenus
Copy link
Member

Could you check type assertion in other files? To further prevent similar panics.

@amyangfei
Copy link
Contributor Author

Could you check type assertion in other files? To further prevent similar panics.

@overvenus .Good suggestion, I added a tracking issue. https://github.com/pingcap/ticdc/issues/2768

@Rustin170506
Copy link
Member

/cc

@amyangfei
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 8fd1cbf

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 9, 2021
@ti-chi-bot
Copy link
Member

@amyangfei: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@amyangfei
Copy link
Contributor Author

/run-integration-tests

6 similar comments
@amyangfei
Copy link
Contributor Author

/run-integration-tests

@amyangfei
Copy link
Contributor Author

/run-integration-tests

@amyangfei
Copy link
Contributor Author

/run-integration-tests

@amyangfei
Copy link
Contributor Author

/run-integration-tests

@amyangfei
Copy link
Contributor Author

/run-integration-tests

@amyangfei
Copy link
Contributor Author

/run-integration-tests

@ti-chi-bot ti-chi-bot merged commit 8827e4c into pingcap:master Sep 9, 2021
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #2781.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #2782.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #2783.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #2784.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. needs-cherry-pick-release-4.0 Should cherry pick this PR to release-4.0 branch. needs-cherry-pick-release-5.0 Should cherry pick this PR to release-5.0 branch. needs-cherry-pick-release-5.1 Should cherry pick this PR to release-5.1 branch. needs-cherry-pick-release-5.2 Should cherry pick this PR to release-5.2 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. status/ptal Could you please take a look? type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

json codec met panic: interface conversion: interface {} is string, not []uint8
6 participants