Skip to content

Commit fae95fc

Browse files
author
Shlomi Noach
committed
Added test for swapping uniqye keys without pk
1 parent dd9a3e1 commit fae95fc

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

localtests/swap-uk-uk/create.sql

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
drop table if exists gh_ost_test;
2+
create table gh_ost_test (
3+
id bigint,
4+
i int not null,
5+
ts timestamp(6),
6+
unique key id_uidx(id),
7+
unique key its_uidx(i, ts)
8+
) ;
9+
10+
drop event if exists gh_ost_test;
11+
delimiter ;;
12+
create event gh_ost_test
13+
on schedule every 1 second
14+
starts current_timestamp
15+
ends current_timestamp + interval 60 second
16+
on completion not preserve
17+
enable
18+
do
19+
begin
20+
insert into gh_ost_test values ((unix_timestamp() << 2) + 0, 11, now(6));
21+
insert into gh_ost_test values ((unix_timestamp() << 2) + 1, 13, now(6));
22+
insert into gh_ost_test values ((unix_timestamp() << 2) + 2, 17, now(6));
23+
insert into gh_ost_test values ((unix_timestamp() << 2) + 3, 19, now(6));
24+
end ;;

localtests/swap-uk-uk/extra_args

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--alter="drop key id_uidx, drop key its_uidx, add unique key its2_uidx(i, ts), add unique key id2_uidx(id)"

localtests/swap-uk-uk/order_by

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
id

0 commit comments

Comments
 (0)