noob here

I don't support the laziness I am about to describe, but I would think
that in the absence of a date, we could use the current date-time.
In the presence of an invalid date, I am pro-error.

Just some thoughts.


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?
>
> 2) Should DATE_FORMAT(NULL, "%Y-&m-%d") produce a NULL value or an error?
>
> 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