Loading mysql-test/r/alter_table.result +6 −0 Original line number Diff line number Diff line Loading @@ -556,3 +556,9 @@ ERROR 3D000: No database selected alter table test.t1 rename test.t1; use test; drop table t1; create table t1 (mycol int(10) not null); alter table t1 alter column mycol set default 0; desc t1; Field Type Null Key Default Extra mycol int(10) NO 0 drop table t1; mysql-test/t/alter_table.test +9 −0 Original line number Diff line number Diff line Loading @@ -401,3 +401,12 @@ use test; drop table t1; # End of 4.1 tests # # Bug #14693 (ALTER SET DEFAULT doesn't work) # create table t1 (mycol int(10) not null); alter table t1 alter column mycol set default 0; desc t1; drop table t1; sql/sql_table.cc +4 −1 Original line number Diff line number Diff line Loading @@ -3379,7 +3379,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), def->change); DBUG_RETURN(TRUE); } def->def=alter->def; // Use new default if ((def->def=alter->def)) // Use new default def->flags&= ~NO_DEFAULT_VALUE_FLAG; else def->flags|= NO_DEFAULT_VALUE_FLAG; alter_it.remove(); } } Loading Loading
mysql-test/r/alter_table.result +6 −0 Original line number Diff line number Diff line Loading @@ -556,3 +556,9 @@ ERROR 3D000: No database selected alter table test.t1 rename test.t1; use test; drop table t1; create table t1 (mycol int(10) not null); alter table t1 alter column mycol set default 0; desc t1; Field Type Null Key Default Extra mycol int(10) NO 0 drop table t1;
mysql-test/t/alter_table.test +9 −0 Original line number Diff line number Diff line Loading @@ -401,3 +401,12 @@ use test; drop table t1; # End of 4.1 tests # # Bug #14693 (ALTER SET DEFAULT doesn't work) # create table t1 (mycol int(10) not null); alter table t1 alter column mycol set default 0; desc t1; drop table t1;
sql/sql_table.cc +4 −1 Original line number Diff line number Diff line Loading @@ -3379,7 +3379,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), def->change); DBUG_RETURN(TRUE); } def->def=alter->def; // Use new default if ((def->def=alter->def)) // Use new default def->flags&= ~NO_DEFAULT_VALUE_FLAG; else def->flags|= NO_DEFAULT_VALUE_FLAG; alter_it.remove(); } } Loading