Skip to content

Commit 63da557

Browse files
MDEV-31684: More tests
1 parent 6f55cb4 commit 63da557

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

mysql-test/main/date_formats.result

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,39 @@ SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone;
592592
current_timezone
593593
+0000 UTC
594594
SET @@time_zone= @old_timezone;
595+
# More timezone test:
596+
#
597+
# Check for time zone with leap seconds
598+
#
599+
set time_zone='Europe/Moscow';
600+
SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z');
601+
DATE_FORMAT('2023-03-01 01:30:00', '%z %Z')
602+
+0300 MSK
603+
SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z');
604+
DATE_FORMAT('2023-04-01 01:30:00', '%z %Z')
605+
+0400 MSD
606+
set time_zone='leap/Europe/Moscow';
607+
SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z');
608+
DATE_FORMAT('2023-03-01 01:30:00', '%z %Z')
609+
+0300 MSK
610+
SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z');
611+
DATE_FORMAT('2023-04-01 01:30:00', '%z %Z')
612+
+0400 MSD
613+
#
614+
# Values around and in spring time-gap
615+
#
616+
set time_zone='MET';
617+
# Normal value with DST
618+
SELECT DATE_FORMAT('2003-03-30 01:59:59', '%z %Z');
619+
DATE_FORMAT('2003-03-30 01:59:59', '%z %Z')
620+
+0100 MET
621+
# Values around and in spring time-gap
622+
SELECT DATE_FORMAT('2023-03-26 01:59:59', '%z %Z');
623+
DATE_FORMAT('2023-03-26 01:59:59', '%z %Z')
624+
+0100 MET
625+
SELECT DATE_FORMAT('2023-03-26 03:00:00', '%z %Z');
626+
DATE_FORMAT('2023-03-26 03:00:00', '%z %Z')
627+
+0200 MEST
595628
#
596629
# End of 11.3 test
597630
#

mysql-test/main/date_formats.test

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,34 @@ SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone;
294294

295295
SET @@time_zone= @old_timezone;
296296

297+
--echo # More timezone test:
298+
299+
--echo #
300+
--echo # Check for time zone with leap seconds
301+
--echo #
302+
set time_zone='Europe/Moscow';
303+
304+
SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z');
305+
SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z');
306+
307+
set time_zone='leap/Europe/Moscow';
308+
SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z');
309+
SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z');
310+
311+
--echo #
312+
--echo # Values around and in spring time-gap
313+
--echo #
314+
315+
set time_zone='MET';
316+
317+
--echo # Normal value with DST
318+
SELECT DATE_FORMAT('2003-03-30 01:59:59', '%z %Z');
319+
320+
--echo # Values around and in spring time-gap
321+
SELECT DATE_FORMAT('2023-03-26 01:59:59', '%z %Z');
322+
SELECT DATE_FORMAT('2023-03-26 03:00:00', '%z %Z');
323+
324+
297325
--echo #
298326
--echo # End of 11.3 test
299327
--echo #

0 commit comments

Comments
 (0)