adding PK, UK, PK-to-UK conversion tests
This commit is contained in:
parent
36a66e0c05
commit
dd9a3e1d0c
22
localtests/fail-no-shared-uk/create.sql
Normal file
22
localtests/fail-no-shared-uk/create.sql
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
drop table if exists gh_ost_test;
|
||||||
|
create table gh_ost_test (
|
||||||
|
id int auto_increment,
|
||||||
|
i int not null,
|
||||||
|
ts timestamp,
|
||||||
|
primary key(id)
|
||||||
|
) auto_increment=1;
|
||||||
|
|
||||||
|
drop event if exists gh_ost_test;
|
||||||
|
delimiter ;;
|
||||||
|
create event gh_ost_test
|
||||||
|
on schedule every 1 second
|
||||||
|
starts current_timestamp
|
||||||
|
ends current_timestamp + interval 60 second
|
||||||
|
on completion not preserve
|
||||||
|
enable
|
||||||
|
do
|
||||||
|
begin
|
||||||
|
insert into gh_ost_test values (null, 11, now());
|
||||||
|
insert into gh_ost_test values (null, 13, now());
|
||||||
|
insert into gh_ost_test values (null, 17, now());
|
||||||
|
end ;;
|
1
localtests/fail-no-shared-uk/expect_failure
Normal file
1
localtests/fail-no-shared-uk/expect_failure
Normal file
@ -0,0 +1 @@
|
|||||||
|
No shared unique key can be found after ALTER
|
1
localtests/fail-no-shared-uk/extra_args
Normal file
1
localtests/fail-no-shared-uk/extra_args
Normal file
@ -0,0 +1 @@
|
|||||||
|
--alter="drop primary key, add primary key (id, i)"
|
24
localtests/swap-pk-uk/create.sql
Normal file
24
localtests/swap-pk-uk/create.sql
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
drop table if exists gh_ost_test;
|
||||||
|
create table gh_ost_test (
|
||||||
|
id bigint,
|
||||||
|
i int not null,
|
||||||
|
ts timestamp(6),
|
||||||
|
primary key(id),
|
||||||
|
unique key its_uidx(i, ts)
|
||||||
|
) ;
|
||||||
|
|
||||||
|
drop event if exists gh_ost_test;
|
||||||
|
delimiter ;;
|
||||||
|
create event gh_ost_test
|
||||||
|
on schedule every 1 second
|
||||||
|
starts current_timestamp
|
||||||
|
ends current_timestamp + interval 60 second
|
||||||
|
on completion not preserve
|
||||||
|
enable
|
||||||
|
do
|
||||||
|
begin
|
||||||
|
insert into gh_ost_test values ((unix_timestamp() << 2) + 0, 11, now(6));
|
||||||
|
insert into gh_ost_test values ((unix_timestamp() << 2) + 1, 13, now(6));
|
||||||
|
insert into gh_ost_test values ((unix_timestamp() << 2) + 2, 17, now(6));
|
||||||
|
insert into gh_ost_test values ((unix_timestamp() << 2) + 3, 19, now(6));
|
||||||
|
end ;;
|
1
localtests/swap-pk-uk/extra_args
Normal file
1
localtests/swap-pk-uk/extra_args
Normal file
@ -0,0 +1 @@
|
|||||||
|
--alter="drop primary key, drop key its_uidx, add primary key (i, ts), add unique key id_uidx(id)"
|
1
localtests/swap-pk-uk/order_by
Normal file
1
localtests/swap-pk-uk/order_by
Normal file
@ -0,0 +1 @@
|
|||||||
|
id
|
22
localtests/swap-uk/create.sql
Normal file
22
localtests/swap-uk/create.sql
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
drop table if exists gh_ost_test;
|
||||||
|
create table gh_ost_test (
|
||||||
|
id int auto_increment,
|
||||||
|
i int not null,
|
||||||
|
ts timestamp,
|
||||||
|
primary key(id)
|
||||||
|
) auto_increment=1;
|
||||||
|
|
||||||
|
drop event if exists gh_ost_test;
|
||||||
|
delimiter ;;
|
||||||
|
create event gh_ost_test
|
||||||
|
on schedule every 1 second
|
||||||
|
starts current_timestamp
|
||||||
|
ends current_timestamp + interval 60 second
|
||||||
|
on completion not preserve
|
||||||
|
enable
|
||||||
|
do
|
||||||
|
begin
|
||||||
|
insert into gh_ost_test values (null, 11, now());
|
||||||
|
insert into gh_ost_test values (null, 13, now());
|
||||||
|
insert into gh_ost_test values (null, 17, now());
|
||||||
|
end ;;
|
1
localtests/swap-uk/extra_args
Normal file
1
localtests/swap-uk/extra_args
Normal file
@ -0,0 +1 @@
|
|||||||
|
--alter="drop primary key, add unique key(id)"
|
Loading…
Reference in New Issue
Block a user