Roland Bouman wrote:
Hi!

On Thu, Jan 15, 2009 at 1:41 PM, Roy Lyseng <[email protected]> wrote:
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.
Not entirely correct, unless I have misinterpreted you.

The format string can be an expression, e.g a column reference. In this case
you rely on a runtime check to see whether the format expression is valid.

Right. But then the example should have read:

STR_TO_DATE(NULL, <expr>)

* Did I ever mention I take things pretty literally?
:)

But I still agree that any invalid format string should cause an
exception...

No kidding - you are right of course - I did not consider the
possibility that the NULL was meant as notation of the value - I
though the NULL keyword was meant as is...my blind spot.

You made me think - again...

You can even have a static and a dynamic error check. The static check could give a "Syntax error" or "NULL value not allowed as function argument" (NULL is simply not allowed as a format), whereas the dynamic check would spit out "Invalid format for conversion".

However, this being a function, which usually allows a more general syntax specification than other constructs, it is OK to skip the static check and delay any checking to runtime.

Thanks,
Roy

_______________________________________________
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