diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
commit | 06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/federated/timestamps.test | |
parent | Initial commit. (diff) | |
download | mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/federated/timestamps.test')
-rw-r--r-- | mysql-test/suite/federated/timestamps.test | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/suite/federated/timestamps.test b/mysql-test/suite/federated/timestamps.test new file mode 100644 index 00000000..7b46b797 --- /dev/null +++ b/mysql-test/suite/federated/timestamps.test @@ -0,0 +1,45 @@ +source have_federatedx.inc; +source include/federated.inc; + +connection slave; +set global time_zone='Europe/Moscow'; +set time_zone='Europe/Moscow'; +create table federated.t1 (dt datetime, ts timestamp, unique(ts)); + +connection master; +set time_zone='+01:00'; +replace_result $SLAVE_MYPORT SLAVE_PORT; +eval create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; + +set @@timestamp=1; # min value +insert t1 values (now(), now()); +set @@timestamp=2147483647; # max value +insert t1 values (now(), now()); +set @@timestamp=1067121000; # DST ambiguous (in Europe/Moscow) +insert t1 values (now(), now()); +set @@timestamp=1067124600; # DST ambiguous (in Europe/Moscow) +insert t1 values (now(), now()); +set @@timestamp=0; + +# reads +select * from t1; + +# deletes +delete from t1 where ts='1970-01-01 01:00:01'; +select * from t1; + +# updates +insert t1 values ('1970-01-01 01:00:01', now()); +update t1 set ts=dt; +select * from t1; + +# index lookups +select * from t1 where ts='2003-10-25 23:30:00'; +select * from t1 where ts='2003-10-26 00:30:00'; + +connection slave; +select * from federated.t1; +set global time_zone=default; +connection master; +drop table t1; +source include/federated_cleanup.inc; |