Bug #14031 TIMESTAMP conflicts with Standard SQL 92 - please change
Submitted: 14 Oct 2005 15:32 Modified: 3 Sep 2009 10:15
Reporter: Jari Aalto Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.0, 5.1, 5.4, 6.0 OS:Any (Any)
Assigned to: CPU Architecture:Any

[14 Oct 2005 15:32] Jari Aalto
Description:
Background: In the polytechnic university (5000 students) we have been using MySQL for educational classes. However we have run into serious problems with the date data types, because MySQL uses different concepts from the SQL standard.

The most problematic is the reserved word TIMESTAMP which SQL 92 standard
specifically assigns for DATE + TIME [+ TIME ZONE] information. In MySQL 
this is interpreted quite differently.

This is a serious prblem, because it makes it impossible to create case studies of cross platform applications that use Standard SQL. In other databases that we have the TIMESTAMP is interpreted in standard way.

Overall the weakest point of MySQL from business programs's point of view are the handling and storing of the times and dates.

How to repeat:
TIMESTAMP is not standards compatible

Suggested fix:
Please consider evaluating the SQL 92 and taking into the use the data types defined in there [1]:

    5.3 <literal>

         ...
         <datetime literal> ::=
                <date literal>
              | <time literal>
              | <timestamp literal>

         <date literal> ::=
              DATE <date string>

         <time literal> ::=
              TIME <time string>

         <timestamp literal> ::=
              TIMESTAMP <timestamp string>

         <time zone interval> ::=
              <sign> <hours value> <colon> <minutes value>

         <date value> ::=
              <years value> <minus sign> <months value> <minus sign> <days value>

         <time value> ::=
              <hours value> <colon> <minutes value> <colon> <seconds value>

   6.1 <data type>
         ...
         <datetime type> ::=
                DATE
              | TIME [ <left paren> <time precision> <right paren> ]
              [ WITH TIME ZONE ]
              | TIMESTAMP [ <left paren> <timestamp precision> <right paren> ]
              [ WITH TIME ZONE ]

         <time precision> ::= <time fractional seconds precision>

         <timestamp precision> ::= <time fractional seconds precision>

         <time fractional seconds precision> ::= <unsigned integer>

         <interval type> ::= INTERVAL <interval qualifier>

Other thinsgs that might want to consider improving against the standards
compliance have been gathered into page [2].

[1] The SQL 92 is downloadable at:
http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt

[2]
Comparison of different SQL implementations
http://troels.arvin.dk/db/rdbms/
[3 Sep 2009 10:15] Susanne Ebrecht
I think we really should implement these two data types:

TIME WITH TIME ZONE 
TIMESTAMP WITH TIME ZONE
[21 Sep 2009 15:26] Peter Gulutzan
I believe it's clear that the reporter was talking about
how the TIMESTAMP data type is non-standard, and not
specifically asking for time zones. Time zones are WL#3744
http://forge.mysql.com/worklog/task.php?id=3744