From 63da557e30df37e21a0e2cd69b8a892ca3fa9e34 Mon Sep 17 00:00:00 2001 From: Rucha Deodhar Date: Thu, 12 Oct 2023 17:11:07 +0530 Subject: [PATCH] MDEV-31684: More tests --- mysql-test/main/date_formats.result | 33 +++++++++++++++++++++++++++++ mysql-test/main/date_formats.test | 28 ++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/mysql-test/main/date_formats.result b/mysql-test/main/date_formats.result index 277ba946e2b..9db6b3212e3 100644 --- a/mysql-test/main/date_formats.result +++ b/mysql-test/main/date_formats.result @@ -592,6 +592,39 @@ SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone; current_timezone +0000 UTC SET @@time_zone= @old_timezone; +# More timezone test: +# +# Check for time zone with leap seconds +# +set time_zone='Europe/Moscow'; +SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z'); +DATE_FORMAT('2023-03-01 01:30:00', '%z %Z') ++0300 MSK +SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z'); +DATE_FORMAT('2023-04-01 01:30:00', '%z %Z') ++0400 MSD +set time_zone='leap/Europe/Moscow'; +SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z'); +DATE_FORMAT('2023-03-01 01:30:00', '%z %Z') ++0300 MSK +SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z'); +DATE_FORMAT('2023-04-01 01:30:00', '%z %Z') ++0400 MSD +# +# Values around and in spring time-gap +# +set time_zone='MET'; +# Normal value with DST +SELECT DATE_FORMAT('2003-03-30 01:59:59', '%z %Z'); +DATE_FORMAT('2003-03-30 01:59:59', '%z %Z') ++0100 MET +# Values around and in spring time-gap +SELECT DATE_FORMAT('2023-03-26 01:59:59', '%z %Z'); +DATE_FORMAT('2023-03-26 01:59:59', '%z %Z') ++0100 MET +SELECT DATE_FORMAT('2023-03-26 03:00:00', '%z %Z'); +DATE_FORMAT('2023-03-26 03:00:00', '%z %Z') ++0200 MEST # # End of 11.3 test # diff --git a/mysql-test/main/date_formats.test b/mysql-test/main/date_formats.test index 0ded67e985f..691966de892 100644 --- a/mysql-test/main/date_formats.test +++ b/mysql-test/main/date_formats.test @@ -294,6 +294,34 @@ SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone; SET @@time_zone= @old_timezone; +--echo # More timezone test: + +--echo # +--echo # Check for time zone with leap seconds +--echo # +set time_zone='Europe/Moscow'; + +SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z'); +SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z'); + +set time_zone='leap/Europe/Moscow'; +SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z'); +SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z'); + +--echo # +--echo # Values around and in spring time-gap +--echo # + +set time_zone='MET'; + +--echo # Normal value with DST +SELECT DATE_FORMAT('2003-03-30 01:59:59', '%z %Z'); + +--echo # Values around and in spring time-gap +SELECT DATE_FORMAT('2023-03-26 01:59:59', '%z %Z'); +SELECT DATE_FORMAT('2023-03-26 03:00:00', '%z %Z'); + + --echo # --echo # End of 11.3 test --echo #