← Back to team overview

maria-developers team mailing list archive

Re: MDEV-14849 CREATE + ALTER with user-invisible columns produce ...

 

Hi, Sachin!

On Jan 29, Sachin Setiya wrote:
> commit 5bd97f22094f3b6a658d503f98022ccd9076bb19
> Author: Sachin Setiya <sachin.setiya@xxxxxxxxxx>
> Date:   Mon Jan 29 12:31:07 2018 +0530
> 
>     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.

ok to push!

Regards,
Sergei
Chief Architect MariaDB
and security@xxxxxxxxxxx