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

executor: insert negative primary key into auto_random table won't trigger rebase #15397

Merged
merged 3 commits into from
Apr 15, 2020

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Mar 16, 2020

What problem does this PR solve?

For now, inserting a negative number into auto_random table will trigger rebase:

create table t (a int primary key auto_random);
insert into t values (-99999999);
insert into t values ();
 select * from t;
+------------+
| a          |
+------------+
| -99999999  |
| 1510612738 |
+------------+

The hex representation of 1510612738 is 5A0A1F02. A lot of auto ids are consumed.

It is more intuitive not to rebase in this case.

What is changed and how it works?

Only rebase auto_random id when the inserted number is positive.

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

Related changes

  • Need to update the documentation

Release note

  • Insert negative primary key into auto_random table won't trigger rebase.

@tangenta tangenta added the sig/execution SIG execution label Mar 16, 2020
@tangenta tangenta requested a review from a team as a code owner March 16, 2020 05:36
@ghost ghost requested review from qw4990 and SunRunAway and removed request for a team March 16, 2020 05:36
@tangenta tangenta requested review from AilinKid and bb7133 March 16, 2020 05:39
@qw4990 qw4990 removed their request for review March 16, 2020 07:09
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM, good job!

@bb7133 bb7133 added this to the v4.0.0-rc milestone Mar 17, 2020
Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM,nice job

Sorry for being absent in this review for such a long time, my fault.

@AilinKid AilinKid added the status/LGT2 Indicates that a PR has LGTM 2. label Apr 15, 2020
@zz-jason zz-jason added the status/can-merge Indicates a PR has been approved by a committer. label Apr 15, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Apr 15, 2020

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants