Skip to content

Commit acd78b3

Browse files
author
Shlomi Noach
committed
adding tests for dropping-then-adding a column
1 parent 3313cb3 commit acd78b3

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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 ;;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--alter="drop column c1, add column c1 int not null after id"

0 commit comments

Comments
 (0)