Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10135

CONVERT_TZ does not work with "out of range" inputs

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.1(EOL)
    • 10.2(EOL)
    • Time zones
    • Linux hostname 3.10.0-327.13.1.el7.x86_64 #1 SMP Thu Mar 31 16:04:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

    Description

      When datetime argument is out of 31 bit timestamp representable domain or would be represented as a 0, CONVERT_TZ silently returns the argument unchanged. Documentation at the time of writing does not mention such behavior.

      Reproduction

      Input

      SELECT      CONVERT_TZ('1970-01-01 00:00:00', '+00:00', @@session.time_zone) AS ``,
                  CONVERT_TZ('1970-01-01 00:00:01', '+00:00', @@session.time_zone) AS ``,
                  CONVERT_TZ('2038-01-19 03:14:07', '+00:00', @@session.time_zone) AS ``,
                  CONVERT_TZ('2038-01-19 03:14:08', '+00:00', @@session.time_zone) AS ``

      Result

      ""	""	""	""
      1970-01-01 00:00:00	1970-01-01 03:00:01	2038-01-19 05:14:07	2038-01-19 03:14:08

      Attachments

        Activity

          People

            bar Alexander Barkov
            pystub Pythtlow Stubson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.