Skip to content

Commit

Permalink
MDEV-31684: More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mariadb-RuchaDeodhar committed Oct 12, 2023
1 parent 6f55cb4 commit 63da557
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
33 changes: 33 additions & 0 deletions mysql-test/main/date_formats.result
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
28 changes: 28 additions & 0 deletions mysql-test/main/date_formats.test
Original file line number Diff line number Diff line change
Expand Up @@ -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 #

0 comments on commit 63da557

Please sign in to comment.