Hi!

On Thu, Jan 15, 2009 at 2:09 AM, Stewart Smith <[email protected]> wrote:
>> Also, what should the following return?
>>
>> SELECT STR_TO_DATE(NULL, '%Y-%m-%d');
>>
>> SELECT STR_TO_DATE(NULL, NULL);
>>
>> MySQL returns a NULL value with no warning for both examples:
>
> I think this is correct behaviour.
>
> along the thought lines of "doing something on nothing will only get you
> nothing".

But NULL is not "nothing" - it is an unknown rather than nothing. This
is "doing something on nothing:

SELECT STR_TO_DATE(,);

My stance for STR_TO_DATE(NULL,NULL); is that you can immediately see
that the format string is invalid. Therefore, it should give an error.

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



-- 
Roland Bouman
http://rpbouman.blogspot.com/

_______________________________________________
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