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

TIMESTAMP variant to support YEAR range -4713 and +9999

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

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            Description MariaDB TIMESTAMP support 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||
            |col 1 row 1|col 2 row 1|col 3 row 1|
            |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 (instread of 4 bytes) to store the "number of seconds since 1970-01-01 00:00:00 UTC" value.

            This task is also a dependency for:

            - MDEV-15750 preserve MYSQL_TYPE_TIMESTAMP in temporal arithmetic

            Using TIMESTAMP arithmetics for the current TIMESTAMP implementation is not very meaningful because of a small TIMESTAMP range.

            MariaDB TIMESTAMP support 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||
            |col 1 row 1|col 2 row 1|col 3 row 1|
            |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 (instread of 4 bytes) to store the "number of seconds since 1970-01-01 00:00:00 UTC" value.

            This task is also a dependency for:

            - MDEV-15750 preserve MYSQL_TYPE_TIMESTAMP in temporal arithmetic

            Using TIMESTAMP arithmetics for the current TIMESTAMP implementation is not very meaningful because of a small TIMESTAMP range.

            bar Alexander Barkov made changes -
            Description MariaDB TIMESTAMP support 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||
            |col 1 row 1|col 2 row 1|col 3 row 1|
            |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 (instread of 4 bytes) to store the "number of seconds since 1970-01-01 00:00:00 UTC" value.

            This task is also a dependency for:

            - MDEV-15750 preserve MYSQL_TYPE_TIMESTAMP in temporal arithmetic

            Using TIMESTAMP arithmetics for the current TIMESTAMP implementation is not very meaningful because of a small TIMESTAMP range.

            MariaDB TIMESTAMP support 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||
            |col 1 row 1|col 2 row 1|col 3 row 1|
            |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 (instread 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              ulong tv_usec;
            };
            {code}

            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.

            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            serg Sergei Golubchik made changes -
            Description MariaDB TIMESTAMP support 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||
            |col 1 row 1|col 2 row 1|col 3 row 1|
            |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 (instread 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              ulong tv_usec;
            };
            {code}

            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.

            MariaDB TIMESTAMP support 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 (instread 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              ulong tv_usec;
            };
            {code}

            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.

            serg Sergei Golubchik made changes -
            Fix Version/s 11.4 [ 29301 ]

            bar, if possible, do not use ulong. It is a very badly portable type. for usec, int32_t is more than enough.

            wlad Vladislav Vaintroub added a comment - bar , if possible, do not use ulong. It is a very badly portable type. for usec, int32_t is more than enough.
            bar Alexander Barkov made changes -
            Description MariaDB TIMESTAMP support 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 (instread 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              ulong tv_usec;
            };
            {code}

            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.

            MariaDB TIMESTAMP support 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 (instread 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            wlad, thanks for your note. I agree. Changed to uint32.

            bar Alexander Barkov added a comment - wlad , thanks for your note. I agree. Changed to uint32.
            bar Alexander Barkov made changes -
            Description MariaDB TIMESTAMP support 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 (instread 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            MariaDB TIMESTAMP support 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 (instread 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            bar Alexander Barkov made changes -
            Description MariaDB TIMESTAMP support 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 (instread 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            MariaDB TIMESTAMP support 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 (instread 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 the system {{struct timeval}}) to transfer values inside the server.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            bar Alexander Barkov made changes -
            Description MariaDB TIMESTAMP support 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 (instread 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 the system {{struct timeval}}) to transfer values inside the server.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            MariaDB TIMESTAMP support 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 (instread 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 the system {{struct timeval}}) to transfer values inside the server, because on most 32-bit systems {{timeval::tv_sec}} is 32 bit, which is not enough.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            bar Alexander Barkov made changes -
            Description MariaDB TIMESTAMP support 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 (instread 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 the system {{struct timeval}}) to transfer values inside the server, because on most 32-bit systems {{timeval::tv_sec}} is 32 bit, which is not enough.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            MariaDB TIMESTAMP support 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 (instread 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 the system {{struct timeval}}) to transfer values inside the server, because on most 32-bit systems {{timeval::tv_sec}} is 32 bit, which is not enough.

            A structure like this should be ok:
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            bar Alexander Barkov made changes -
            Description MariaDB TIMESTAMP support 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 (instread 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 the system {{struct timeval}}) to transfer values inside the server, because on most 32-bit systems {{timeval::tv_sec}} is 32 bit, which is not enough.

            A structure like this should be ok:
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            MariaDB TIMESTAMP support 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            bar Alexander Barkov made changes -
            Description MariaDB TIMESTAMP support 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            MariaDB TIMESTAMP support 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            bar Alexander Barkov made changes -
            Description MariaDB TIMESTAMP support 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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            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.
            {code:cpp}
            struct {
              longlong tv_sec; -- signed, to store negative years
              uint32 tv_usec;
            };
            {code}

            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.

            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -

            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.