mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-9629 Disappearing PRI from Key column after creating a trigger
when creating shadow nullable fields, preserve all original field flags (because we swap flags back and forth in not_null_fields_have_null_values())
This commit is contained in:
@ -341,3 +341,17 @@ create trigger tr1 before update on t1 for each row do 1;
|
||||
create trigger tr2 after update on t2 for each row update t1 set a=new.f2;
|
||||
update t2 set f2=1 where f1=1;
|
||||
drop table t1, t2;
|
||||
create table t1 (a int not null, primary key (a));
|
||||
insert into t1 (a) values (1);
|
||||
show columns from t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO PRI NULL
|
||||
create trigger t1bu before update on t1 for each row begin end;
|
||||
show columns from t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO PRI NULL
|
||||
insert into t1 (a) values (3);
|
||||
show columns from t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO PRI NULL
|
||||
drop table t1;
|
||||
|
@ -360,3 +360,15 @@ create trigger tr1 before update on t1 for each row do 1;
|
||||
create trigger tr2 after update on t2 for each row update t1 set a=new.f2;
|
||||
update t2 set f2=1 where f1=1;
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# MDEV-9629 Disappearing PRI from Key column after creating a trigger
|
||||
#
|
||||
create table t1 (a int not null, primary key (a));
|
||||
insert into t1 (a) values (1);
|
||||
show columns from t1;
|
||||
create trigger t1bu before update on t1 for each row begin end;
|
||||
show columns from t1;
|
||||
insert into t1 (a) values (3);
|
||||
show columns from t1;
|
||||
drop table t1;
|
||||
|
@ -1101,6 +1101,7 @@ bool Table_triggers_list::prepare_record_accessors(TABLE *table)
|
||||
table == (*fld)->table)))
|
||||
return 1;
|
||||
|
||||
f->flags= (*fld)->flags;
|
||||
f->null_ptr= null_ptr;
|
||||
f->null_bit= null_bit;
|
||||
if (null_bit == 128)
|
||||
|
Reference in New Issue
Block a user