Skip to content

Commit

Permalink
Merge pull request #8338 from planetscale/online-ddl-vrepl-pk-datetim…
Browse files Browse the repository at this point in the history
…e-to-ts

Online DDL/VReplication: add PK DATETIME->TIMESTAMP test
  • Loading branch information
shlomi-noach authored Jun 16, 2021
2 parents a3c34a3 + 3ba552d commit d163ca0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
change column t t timestamp default current_timestamp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
drop table if exists onlineddl_test;
create table onlineddl_test (
id int unsigned auto_increment,
i int not null,
ts0 timestamp default current_timestamp,
ts1 timestamp null,
dt2 datetime,
t datetime default current_timestamp,
updated tinyint unsigned default 0,
primary key(id, t),
key i_idx(i)
) auto_increment=1;

drop event if exists onlineddl_test;
delimiter ;;
create event onlineddl_test
on schedule every 1 second
starts current_timestamp
ends current_timestamp + interval 60 second
on completion not preserve
enable
do
begin
insert into onlineddl_test values (null, 7, null, now(), now(), '2010-10-20 10:20:30', 0);

insert into onlineddl_test values (null, 11, null, now(), now(), '2010-10-20 10:20:30', 0);
update onlineddl_test set dt2=now() + interval 1 minute, updated = 1 where i = 11 order by id desc limit 1;

insert into onlineddl_test values (null, 13, null, now(), now(), '2010-10-20 10:20:30', 0);
update onlineddl_test set t=t + interval 1 minute, updated = 1 where i = 13 order by id desc limit 1;
end ;;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(5.5)

0 comments on commit d163ca0

Please sign in to comment.