On Jan 9, 2009, at 11:36 AM, Jay Pipes wrote:

All:

Here is the current behaviour of DATE_FORMAT():

mysql> SELECT DATE_FORMAT(NULL, "%Y-%m-%d");
+-------------------------------+
| DATE_FORMAT(NULL, "%Y-%m-%d") |
+-------------------------------+
| NULL                          |
+-------------------------------+
1 row in set (0.04 sec)

mysql> SELECT DATE_FORMAT("xxx", "%Y-%m-%d");
+--------------------------------+
| DATE_FORMAT("xxx", "%Y-%m-%d") |
+--------------------------------+
| NULL                           |
+--------------------------------+
1 row in set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+-------------------------------------------+
| Level   | Code | Message                                   |
+---------+------+-------------------------------------------+
| Warning | 1292 | Truncated incorrect datetime value: 'xxx' |
+---------+------+-------------------------------------------+
1 row in set (0.00 sec)

Question:

1) Is this behaviour appropriate? Should the warning be changed to an error in the second case?
Error



2) Should DATE_FORMAT(NULL, "%Y-&m-%d") produce a NULL value or an error?
NULL seems good to me there.


Thanks in advance for your input.

Cheers,

Jay

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to