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

drainer/: Fix when pk is handle and value overflow int64 #573

Merged
merged 2 commits into from Apr 30, 2019

Conversation

Projects
None yet
4 participants
@july2993
Copy link
Collaborator

commented Apr 29, 2019

What problem does this PR solve?

Fix when pk is handle and value overflow int64
can fix https://internal.pingcap.net/jira/browse/TOOL-1132

before this pr:

mysql> create table pk(`id` bigint(20) UNSIGNED NOT NULL primary key);
insert into pk(id) values(18446744073709551615);  // this will failed we insert -1 at downstream

note uint64(int64(-1)) = 18446744073709551615

the test added also fix https://internal.pingcap.net/jira/browse/TOOL-1139

What is changed and how it works?

change to uint64 from int64 when the pk column is unsigned

Check List

Tests

  • Integration test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch
@july2993

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 29, 2019

/run-all-tests

@july2993 july2993 requested review from suzaku and csuzhangxc Apr 29, 2019

@GregoryIan

This comment has been minimized.

Copy link
Collaborator

commented Apr 29, 2019

I think the important thing is what's nature the issue implies, Is it that a single Datum object cannot indicate the real type of column data? It seems we must need the help of column type to correctly interpret a column data

Show resolved Hide resolved tests/dailytest/case.go Outdated
Show resolved Hide resolved tests/dailytest/case.go Outdated
@csuzhangxc
Copy link
Member

left a comment

LGTM

@csuzhangxc csuzhangxc added status/LGT1 and removed status/PTAL labels Apr 30, 2019

@suzaku

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

LGTM

@july2993 july2993 added status/LGT2 and removed status/LGT1 labels Apr 30, 2019

@GregoryIan
Copy link
Collaborator

left a comment

LGTM

@july2993 july2993 merged commit 825e88a into master Apr 30, 2019

2 checks passed

idc-jenkins-ci-binlog/build Jenkins job succeeded.
Details
idc-jenkins-ci-binlog/check Jenkins job succeeded.
Details

@july2993 july2993 deleted the hjh/fix_pk_type branch Apr 30, 2019

GregoryIan added a commit that referenced this pull request May 7, 2019

release 3.0 rebase master (#587)
* drainer/: Fix when pk is handle and value overflow int64 (#573)

* arbiter: Refactor and add more unit tests (#570)

* More tests for arbiter

* Log os.Hostname error

* drainer: Refactor, eliminate duplicate code by introducing a taskGroup (#572)

* Refactor, eliminate duplicate code by introducing a taskGroup

* Use zap.Stack directly

* binlogctl: refine log output when use help command (#580)

* Minor edits to README (#583)

* drainer: Refactor and add unit tests (#571)

* Add tests for drainer

* Use DeepEquals to simplify map testing

* Just import context

* Use Equals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.