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: fix autoid doesn't handle float, double type and tiny cleanup #11110

Merged
merged 12 commits into from Jul 22, 2019

Conversation

nange
Copy link
Contributor

@nange nange commented Jul 6, 2019

What problem does this PR solve?

Fixes #11109

What is changed and how it works?

modify the adjustAutoIncrementDatum method logic, handle the float and double scenario.

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

@codecov
Copy link

codecov bot commented Jul 6, 2019

Codecov Report

Merging #11110 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #11110   +/-   ##
===========================================
  Coverage   81.3669%   81.3669%           
===========================================
  Files           423        423           
  Lines         90479      90479           
===========================================
  Hits          73620      73620           
  Misses        11574      11574           
  Partials       5285       5285

@crazycs520
Copy link
Contributor

/run-all-tests

@crazycs520
Copy link
Contributor

@tiancaiamao @lysu PTAL

@crazycs520 crazycs520 added type/bug-fix This PR fixes a bug. contribution This PR is from a community contributor. labels Jul 6, 2019
@crazycs520
Copy link
Contributor

/run-unit-test

1 similar comment
@bb7133
Copy link
Member

bb7133 commented Jul 7, 2019

/run-unit-test

executor/insert_common.go Outdated Show resolved Hide resolved
@nange
Copy link
Contributor Author

nange commented Jul 8, 2019

There's another case the pr doesn't handle. eg: update stmt. I would like to mark the pr to "WIP". And more test case should add also.

@nange nange changed the title executor: fix autoid doesn't handle float, double type and tiny cleanup [WIP] executor: fix autoid doesn't handle float, double type and tiny cleanup Jul 8, 2019
@nange nange changed the title [WIP] executor: fix autoid doesn't handle float, double type and tiny cleanup executor: fix autoid doesn't handle float, double type and tiny cleanup Jul 11, 2019
@nange
Copy link
Contributor Author

nange commented Jul 11, 2019

@winkyao @lzmhhh123 please review again, thanks.

@imtbkcat
Copy link

/run-all-tests

@nange
Copy link
Contributor Author

nange commented Jul 12, 2019

/run-all-tests

Copy link

@imtbkcat imtbkcat left a comment

Choose a reason for hiding this comment

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

LGTM

@imtbkcat
Copy link

PTAL @winkyao

@imtbkcat
Copy link

PTAL @crazycs520 @lzmhhh123

{
`insert into t4(id) values(6)`,
`select * from t4 where id = 6`,
testkit.Rows(`6 6`),
Copy link
Contributor

Choose a reason for hiding this comment

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

It isn't compatible with MySQL5.7, the result of MySQL is as follows:

mysql> select * from t4 where id = 6;
+----+---+
| id | n |
+----+---+
|  6 | 7 |
+----+---+
1 row in set (0.01 sec)

Copy link
Contributor Author

@nange nange Jul 19, 2019

Choose a reason for hiding this comment

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

@zimulala fixed! thank you!
BTW, the update behavior is the same as MySQL8.0, but is not the same as MySQL5.7. I think the behavior of MySQL8.0 is expected to me.

@lzmhhh123 lzmhhh123 added needs-cherry-pick-2.1 status/LGT1 Indicates that a PR has LGTM 1. labels Jul 22, 2019
Copy link
Member

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

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

LGTM.

@lzmhhh123
Copy link
Member

/run-all-tests

@lzmhhh123 lzmhhh123 merged commit b3f7186 into pingcap:master Jul 22, 2019
@lzmhhh123 lzmhhh123 added status/all tests passed status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 22, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Jul 22, 2019

cherry pick to release-2.1 failed

@sre-bot
Copy link
Contributor

sre-bot commented Jul 22, 2019

cherry pick to release-3.0 failed

lzmhhh123 added a commit to lzmhhh123/tidb that referenced this pull request Jul 24, 2019
imtbkcat pushed a commit to lzmhhh123/tidb that referenced this pull request Jul 26, 2019
sre-bot added a commit to lzmhhh123/tidb that referenced this pull request Jul 26, 2019
crazycs520 added a commit to crazycs520/tidb that referenced this pull request Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. status/LGT2 Indicates that a PR has LGTM 2. type/bug-fix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autoid value is incorrect when field type is float or double
8 participants