From 004a6fe65c671d19b9c0725ec34d27c31c6c00e7 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 25 Dec 2016 14:20:36 +0200 Subject: [PATCH] adding a failing test: compounf primary key with timestamp column --- localtests/compound-pk-ts/create.sql | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 localtests/compound-pk-ts/create.sql diff --git a/localtests/compound-pk-ts/create.sql b/localtests/compound-pk-ts/create.sql new file mode 100644 index 0000000..157cfe9 --- /dev/null +++ b/localtests/compound-pk-ts/create.sql @@ -0,0 +1,34 @@ +drop table if exists gh_ost_test; +create table gh_ost_test ( + id int auto_increment, + i int not null, + ts0 timestamp default current_timestamp, + updated tinyint unsigned default 0, + primary key(id, ts0) +) 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(), 0); + update gh_ost_test set updated = 1 where i = 11 order by id desc limit 1; + + insert into gh_ost_test values (null, 13, now(), 0); + update gh_ost_test set updated = 1 where i = 13 order by id desc limit 1; + + insert into gh_ost_test values (null, 17, now(), 0); + update gh_ost_test set updated = 1 where i = 17 order by id desc limit 1; + + insert into gh_ost_test values (null, 19, now(), 0); + update gh_ost_test set updated = 1 where i = 19 order by id desc limit 1; + + insert into gh_ost_test values (null, 23, now(), 0); + update gh_ost_test set updated = 1 where i = 23 order by id desc limit 1; +end ;;