-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix auto_increment bugs with large values
Summary: Fix auto_increment bugs with large values There are currently a few related bugs in our autoincrement implementation relating to large values. 1. When inserting values larger than LLONG_MAX, we do not bump the autoincrement counter on the table because we are using signed 64bit integers to store autoincrement. Fix by converting to use ulonglong. 2. When `auto_increment_increment` is set, and the next number in the sequence is larger than ULLONG_MAX, we are not currently do not error out, and instead insert smaller values, due to underflow. Fix by calculating next value more carefully, and return ULLONG_MAX when limit is reached, so that the server can handle appropriately. 3. `get_auto_increment` can return values that are greater than the maximum allowed value for the column type. Although the SQL layer truncates the value, the value is still stored inside the SE, which means that SHOW CREATE TABLE can show invalid values from auto_increment columns. Closes #720 Differential Revision: D5955645 Pulled By: lth fbshipit-source-id: bac7562
- Loading branch information
1 parent
4cf30c7
commit 4d66a66
Showing
8 changed files
with
318 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.