-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
fix(tianmu): AUTO_INCREMENT of the Primary Key with tianmu occurs the problem of max value about data type(#1046) #1144
Conversation
Thanks for the contribution! Please review the labels and make any necessary changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov ReportBase: 42.73% // Head: 42.73% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## stonedb-5.7-dev #1144 +/- ##
================================================
Coverage 42.73% 42.73%
================================================
Files 1830 1830
Lines 395970 395989 +19
================================================
+ Hits 169223 169233 +10
- Misses 226747 226756 +9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Summary about this PR
Issue Number: close #1046
Analysis: When the auto-increment obtained is greater than the maximum value of the data type, the inserted data will become negative. According to the debugging analysis of the code, it is found that the auto-increment maximum value obtained is not compared with the maximum value that the type can store, so the value overflow occurs.
Solution: Compare the type maximum value with auto-increment value. When the auto-increment value is less than the maximum value, it can be inserted normally. When the auto-increment value is is greater than the maximum value, it will report the error of primary key conflict.
main fix: if auto_inc_value < max_value, return auto_inc_value else return max_value,also consider the unsigned auto_increment column and primary key conflict.
Tests Check List
Changelog
Documentation