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

lightning: fix id allocator base for double auto_increment field #1178

Merged
merged 2 commits into from
Jun 9, 2021

Conversation

glorv
Copy link
Collaborator

@glorv glorv commented Jun 7, 2021

What problem does this PR solve?

Fix the bug that lightning will got invalid auto_increment base if the corresponding auto_increment field is double/float.

[2021/06/05 13:37:03.227 +08:00] [INFO] [tidb.go:355] ["alter table auto_increment start"] [table=`db`.`table`] [auto_increment=4753151844738400257]

What is changed and how it works?

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

Side effects

Related changes

Release note

  • Fix the bug that lightning rebase wrong auto_increment base when the auto_increment field type is float or double.

@ti-chi-bot ti-chi-bot added the status/LGT1 LGTM1 label Jun 7, 2021
@glorv glorv added this to the v5.1.0 milestone Jun 7, 2021
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer
  • kennytm

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 status/LGT2 LGTM2 and removed status/LGT1 LGTM1 labels Jun 9, 2021
@glorv
Copy link
Collaborator Author

glorv commented Jun 9, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 602d10b

@ti-chi-bot ti-chi-bot merged commit 8bac225 into pingcap:master Jun 9, 2021
@glorv glorv deleted the fix-auto-id branch June 9, 2021 12:12
ti-chi-bot pushed a commit to ti-chi-bot/br that referenced this pull request Jun 9, 2021
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

//
// See: https://github.com/pingcap/tidb/blob/47f0f15b14ed54fc2222f3e304e29df7b05e6805/executor/insert_common.go#L781-L852
// TODO: merge this with pkg/lightning/backend/kv/sql2kv.go
func getAutoRecordID(d types.Datum, target *types.FieldType) int64 {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should make the function getAutoRecordID in the TiDB repo be a public interface to avoid further inconsistent behaviors.

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.

None yet

5 participants