-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8338 from planetscale/online-ddl-vrepl-pk-datetim…
…e-to-ts Online DDL/VReplication: add PK DATETIME->TIMESTAMP test
- Loading branch information
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
go/test/endtoend/onlineddl/vrepl_suite/testdata/datetime-to-timestamp-pk/alter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
change column t t timestamp default current_timestamp |
31 changes: 31 additions & 0 deletions
31
go/test/endtoend/onlineddl/vrepl_suite/testdata/datetime-to-timestamp-pk/create.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ;; |
1 change: 1 addition & 0 deletions
1
go/test/endtoend/onlineddl/vrepl_suite/testdata/datetime-to-timestamp-pk/ignore_versions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(5.5) |
File renamed without changes.