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

TIMESTAMP variant to support YEAR range -4713 and +9999

    XMLWordPrintable

Details

    Description

      MariaDB TIMESTAMP supports year values in the range 1970..2038, and after MDEV-32188 it's going to support year values in the range 1970..2106.

      This range is still narrower than most other databases support:

      Data type Min Max
      Oracle TIMESTAMP -4713 9999
      DB2 TIMESTAP 0001 9999
      PostgreSQL TIMESTAMP -4713 294276
      SQL Server DATETIME2 0001 9999
      SQL Server DATETIME 1753 9999

      For migration purposes, we need a data type which will cover at least the range -4713..9999.

      It will need 5 bytes (instead of 4 bytes) to store the "number of seconds since 1970-01-01 00:00:00 UTC" value.

      Also, it will need a new C++ data type (instead of struct timeval) to transfer values inside the server.

      struct {
        longlong tv_sec; -- signed, to store negative years
        uint32 tv_usec; 
      };
      

      This task is also a dependency for

      • MDEV-15750 preserve MYSQL_TYPE_TIMESTAMP in temporal arithmetic

      Using TIMESTAMP arithmetic for the current TIMESTAMP implementation is not very meaningful because of the too small TIMESTAMP range.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bar Alexander Barkov
              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.