-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-14849 CREATE + ALTER with user-invisible columns produce ...
Problem:- create or replace table t1 (pk int auto_increment primary key invisible, i int); alter table t1 modify pk int invisible; This last alter makes a invisible column which is not null and does not have default value. Analysis:- This is caused because our error check for NOT_NULL_FLAG and NO_DEFAULT_VALUE_FLAG flag misses this sql_field , but this is not the fault of error check :).Actually this field come via mysql_prepare_alter_table and it does not have NO_DEFAULT_VALUE_FLAG flag turned on. (If it was create table NO_DEFAULT_VALUE_FLAG would have turned on Column_definition::check) and this would have generated error. Solution:- I have moved the error check to kind last of mysql_prepare_create_table because upto this point we have applied NO_DEFAULT_VALUE_FLAG to required column.
- Loading branch information
1 parent
2d73b58
commit 16be746
Showing
3 changed files
with
21 additions
and
11 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