Comment 3 for bug 597778

Revision history for this message
Patrick Crews (patrick-crews) wrote : Re: [Bug 597778] Re: TIMESTAMP columns allow values up to 61 for seconds

I'm thinking the value should be 60 as well (not 61):
Modern Unix time is based strictly on
UTC<http://en.wikipedia.org/wiki/Coordinated_Universal_Time>.
UTC counts time using SI <http://en.wikipedia.org/wiki/SI> seconds, and
breaks up the span of time into days. UTC days are almost always 86 400 s
long, but due to "leap seconds <http://en.wikipedia.org/wiki/Leap_seconds>"
are occasionally 86 401 s and could be 86 399 s long (though the latter
option has never been used as of January 2010)

On Sun, Jul 4, 2010 at 3:59 AM, Hartmut Holzgraefe <email address hidden> wrote:

> The value should be 60, not 61? As far as i understand there can be
> multiple leap seconds per year (as we had 1972), but not on the same day
> ...
>
> Extra checks that *could* be added if _seconds==60:
>
> * leap seconds can only happen in the last minute of an UTC day
> * leap seconds usually happen on Jun 30th or Dec 31st (and so far
> exclusively have)
> ** English Wikipedia says theoretically they could be inserted at the end
> of any month
> ** German Wikipedia says prefered dates are in June or December,
> alternative dates are end of March or September, so impiles they could
> happen at the end of a quarter only
>
> --
> TIMESTAMP columns allow values up to 61 for seconds
> https://bugs.launchpad.net/bugs/597778
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in A Lightweight SQL Database for Cloud and Web: Confirmed
>
> Bug description:
> TIMESTAMP columns can take values with seconds up to 61 (will fail if >
> 61).
> The value is converted:
> INSERT INTO t1 (b) VALUES('2000-01-01 12:00:61'); -> insert_value:
> "2000-01-01 12:01:01"
>
> Test case:
> --disable_warnings
> DROP TABLE IF EXISTS t1;
> --enable_warnings
>
> CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TIMESTAMP);
> # This INSERT should fail with ERROR 1685 (bad UNIX TIMESTAMP)
> INSERT INTO t1 (b) VALUES('2000-01-01 12:00:61');
> SELECT * FROM t1;
>
> DROP TABLE t1;
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/drizzle/+bug/597778/+subscribe
>