Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-31631 Adding auto-increment to table with history online misbehaves
Adding an auto_increment column online leads to an undefined behavior. Basically any DEFAULTs that depend on a row order in the table, or on the non-deterministic (in scope of the ALTER TABLE statement) function is UB. For example, NOW() is considered generally non-deterministic (Item_func_now_utc is marked with VCOL_NON_DETERMINISTIC), but it's fixed in scope of a single statement. Same for any other function that depends only on the session/status vars apart from its arguments. Only two UB cases are known: * adding new AUTO_INCREMENT column. Modifying the existing column may be fine under certain circumstances, see MDEV-31058. * adding new column with DEFAULT(nextval(...)). Modifying the existing column is possible, since its value will be always present in the online event, except for the NULL -> NOT NULL modification
- Loading branch information
1 parent
e026a36
commit 44ca37e
Showing
5 changed files
with
76 additions
and
32 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 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 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