File tree Expand file tree Collapse file tree
localtests/drop-null-add-not-null Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ drop table if exists gh_ost_test;
2+ create table gh_ost_test (
3+ id int auto_increment,
4+ c1 int null ,
5+ c2 int not null ,
6+ primary key (id)
7+ ) auto_increment= 1 ;
8+
9+ insert into gh_ost_test values (null , null , 17 );
10+ insert into gh_ost_test values (null , null , 19 );
11+
12+ drop event if exists gh_ost_test;
13+ delimiter ;;
14+ create event gh_ost_test
15+ on schedule every 1 second
16+ starts current_timestamp
17+ ends current_timestamp + interval 60 second
18+ on completion not preserve
19+ enable
20+ do
21+ begin
22+ insert ignore into gh_ost_test values (101 , 11 , 23 );
23+ insert ignore into gh_ost_test values (102 , 13 , 23 );
24+ insert into gh_ost_test values (null , 17 , 23 );
25+ insert into gh_ost_test values (null , null , 29 );
26+ set @last_insert_id := last_insert_id();
27+ -- update gh_ost_test set c2=c2+@last_insert_id where id=@last_insert_id order by id desc limit 1;
28+ delete from gh_ost_test where id= 1 ;
29+ delete from gh_ost_test where c1= 13 ; -- id=2
30+ end ;;
Original file line number Diff line number Diff line change 1+ --alter="drop column c1, add column c1 int not null after id"
You can’t perform that action at this time.
0 commit comments