refined tests: tz-datetime only tests datetime issues; tz-datetime-ts converts datetime to timestamp
This commit is contained in:
parent
420370433d
commit
ddf4f88338
@ -102,15 +102,15 @@ test_single() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo_dot
|
echo_dot
|
||||||
orig_checksum=$(gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${orig_columns} from gh_ost_test" -ss | md5sum)
|
orig_checksum=$(gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "set session time_zone='+00:00'; select ${orig_columns} from gh_ost_test" -ss | md5sum)
|
||||||
ghost_checksum=$(gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${ghost_columns} from _gh_ost_test_gho" -ss | md5sum)
|
ghost_checksum=$(gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "set session time_zone='+00:00'; select ${ghost_columns} from _gh_ost_test_gho" -ss | md5sum)
|
||||||
|
|
||||||
if [ "$orig_checksum" != "$ghost_checksum" ] ; then
|
if [ "$orig_checksum" != "$ghost_checksum" ] ; then
|
||||||
echo "ERROR $test_name: checksum mismatch"
|
echo "ERROR $test_name: checksum mismatch"
|
||||||
echo "---"
|
echo "---"
|
||||||
gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${orig_columns} from gh_ost_test" -ss
|
gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "set session time_zone='+00:00'; select ${orig_columns} from gh_ost_test" -ss
|
||||||
echo "---"
|
echo "---"
|
||||||
gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${ghost_columns} from _gh_ost_test_gho" -ss
|
gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "set session time_zone='+00:00'; select ${ghost_columns} from _gh_ost_test_gho" -ss
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
42
localtests/tz-datetime-ts/create.sql
Normal file
42
localtests/tz-datetime-ts/create.sql
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
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,
|
||||||
|
ts1 timestamp,
|
||||||
|
ts2 timestamp,
|
||||||
|
t datetime,
|
||||||
|
updated tinyint unsigned default 0,
|
||||||
|
primary key(id),
|
||||||
|
key i_idx(i)
|
||||||
|
) 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, null, now(), now(), '2010-10-20 10:20:30', 0);
|
||||||
|
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 11 order by id desc limit 1;
|
||||||
|
|
||||||
|
set session time_zone='system';
|
||||||
|
insert into gh_ost_test values (null, 11, null, now(), now(), '2010-10-20 10:20:30', 0);
|
||||||
|
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 13 order by id desc limit 1;
|
||||||
|
|
||||||
|
set session time_zone='+00:00';
|
||||||
|
insert into gh_ost_test values (null, 17, null, now(), now(), '2010-10-20 10:20:30', 0);
|
||||||
|
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 17 order by id desc limit 1;
|
||||||
|
|
||||||
|
set session time_zone='-03:00';
|
||||||
|
insert into gh_ost_test values (null, 19, null, now(), now(), '2010-10-20 10:20:30', 0);
|
||||||
|
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 19 order by id desc limit 1;
|
||||||
|
|
||||||
|
set session time_zone='+05:00';
|
||||||
|
insert into gh_ost_test values (null, 23, null, now(), now(), '2010-10-20 10:20:30', 0);
|
||||||
|
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 23 order by id desc limit 1;
|
||||||
|
end ;;
|
1
localtests/tz-datetime-ts/extra_args
Normal file
1
localtests/tz-datetime-ts/extra_args
Normal file
@ -0,0 +1 @@
|
|||||||
|
--alter="change column t t timestamp not null"
|
@ -3,9 +3,8 @@ create table gh_ost_test (
|
|||||||
id int auto_increment,
|
id int auto_increment,
|
||||||
i int not null,
|
i int not null,
|
||||||
ts0 timestamp default current_timestamp,
|
ts0 timestamp default current_timestamp,
|
||||||
ts1 timestamp,
|
ts1 datetime,
|
||||||
ts2 timestamp,
|
ts2 datetime,
|
||||||
dt datetime,
|
|
||||||
updated tinyint unsigned default 0,
|
updated tinyint unsigned default 0,
|
||||||
primary key(id),
|
primary key(id),
|
||||||
key i_idx(i)
|
key i_idx(i)
|
||||||
@ -21,22 +20,22 @@ create event gh_ost_test
|
|||||||
enable
|
enable
|
||||||
do
|
do
|
||||||
begin
|
begin
|
||||||
insert into gh_ost_test values (null, 11, null, now(), now(), '2010-10-20 10:20:30', 0);
|
insert into gh_ost_test values (null, 11, null, now(), now(), 0);
|
||||||
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 11 order by id desc limit 1;
|
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 11 order by id desc limit 1;
|
||||||
|
|
||||||
set session time_zone='system';
|
set session time_zone='system';
|
||||||
insert into gh_ost_test values (null, 11, null, now(), now(), '2010-10-20 10:20:30', 0);
|
insert into gh_ost_test values (null, 13, null, now(), now(), 0);
|
||||||
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 13 order by id desc limit 1;
|
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 13 order by id desc limit 1;
|
||||||
|
|
||||||
set session time_zone='+00:00';
|
set session time_zone='+00:00';
|
||||||
insert into gh_ost_test values (null, 17, null, now(), now(), '2010-10-20 10:20:30', 0);
|
insert into gh_ost_test values (null, 17, null, now(), now(), 0);
|
||||||
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 17 order by id desc limit 1;
|
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 17 order by id desc limit 1;
|
||||||
|
|
||||||
set session time_zone='-03:00';
|
set session time_zone='-03:00';
|
||||||
insert into gh_ost_test values (null, 19, null, now(), now(), '2010-10-20 10:20:30', 0);
|
insert into gh_ost_test values (null, 19, null, now(), now(), 0);
|
||||||
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 19 order by id desc limit 1;
|
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 19 order by id desc limit 1;
|
||||||
|
|
||||||
set session time_zone='+05:00';
|
set session time_zone='+05:00';
|
||||||
insert into gh_ost_test values (null, 23, null, now(), now(), '2010-10-20 10:20:30', 0);
|
insert into gh_ost_test values (null, 23, null, now(), now(), 0);
|
||||||
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 23 order by id desc limit 1;
|
update gh_ost_test set ts2=now() + interval 10 minute, updated = 1 where i = 23 order by id desc limit 1;
|
||||||
end ;;
|
end ;;
|
||||||
|
@ -1 +0,0 @@
|
|||||||
--alter="change column dt dt timestamp not null"
|
|
Loading…
Reference in New Issue
Block a user