* Konstantin Osipov <kos...@sun.com> [09/02/05 03:35]:
> > People are using MySQL because it's different and can satisfy their
> > needs. Standards are useful, but not important for our current or
> > future users.  Getting the job done and not having downtime, even when
> > upgrading, that is important!

Hear, Monty, there has never been consensus about it even
among you and David :-).

----- Forwarded message from David Axmark <david.axm...@gmail.com> -----

Date: Fri, 09 Jan 2009 11:01:26 +1000
From: David Axmark <david.axm...@gmail.com>
To: Jay Pipes <jay.pi...@sun.com>
Cc: drizzle-discuss Discuss <drizzle-disc...@lists.launchpad.net>
Subject: Re: [Drizzle-discuss] Vote/Discuss: FROM_UNIXTIME() behaviour

ERROR!

I have always hated the way MySQL has taken strings like 1232STRING as a
number. Leads to tons of stupid errors hidden deep in applications.

/David

On Thu, 2009-01-08 at 16:29 -0500, Jay Pipes wrote:
> All:
> 
> mysql> SELECT FROM_UNIXTIME("2008-01-08 03:14:07");
> +--------------------------------------+
> | FROM_UNIXTIME("2008-01-08 03:14:07") |
> +--------------------------------------+
> | 1969-12-31 19:33:28                  |
> +--------------------------------------+
> 1 row in set, 1 warning (0.00 sec)
> 
> mysql> show warnings;
> +---------+------+----------------------------------------------------------+
> | Level   | Code | Message 
>      |
> +---------+------+----------------------------------------------------------+
> | Warning | 1292 | Truncated incorrect INTEGER value: '2008-01-08 
> 03:14:07' |
> +---------+------+----------------------------------------------------------+
> 1 row in set (0.00 sec)
> 
> I was actually surprised to find this was the behaviour in MySQL and 
> Drizzle.
> 
> Would anyone have a problem if I converted the above to an error? 
> FROM_UNIXTIME() only takes unsigned integers in the range of 0 to 
> INT32_MAX.  It doesn't take strings, or strings that "look like 
> numbers", or anything of the sort.
> 
> IMHO, the above behaviour is dangerous, as it:
> 
> * Implicitly tries to convert a string to an integer (based on the warning)
> * Produces an invalid TIMESTAMP value
> * Doesn't error, therefore giving the unassuming user the impression 
> that FROM_UNIXTIME() indeed takes string parameters.
> 
> Anyone object to me making the above an error?
> 
> Cheers,
> 
> Jay
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to     : drizzle-disc...@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : drizzle-disc...@lists.launchpad.net
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

----- End forwarded message -----

-- 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to