Subject RE: [firebird-support] strange problem with extract(month from "date")
Author Helen Borrie
At 03:01 PM 28/01/2004 -0200, you wrote:
>At 17:38 28/01/2004 +0100, you wrote:
> >Alexandre,
> >
> >[snip]
> >
> >I opened a thread on 26.06.2003 in firebird-devel with a subject
> >"Possibly a bug: "Expression evaluation not supported" that matches
> >exactly your test case. I repost here Claudio's last message about
> >that issue. Don't know if his suggestion ever went into the code
> >base.
> >
> ><quote>
> >Hi, Thomas. The data types involves don't matter, provided that you have a
> >date/time field in the optional table and that you call extract() on this
> >field.
> >I managed to produce it with:
> >...snip....
>Hi Thomas,
>This is exactly what happened....
>I have look trough WhatsNew.txt and found a Correction made by Claudio
> * Fixed bug SF #538201.
> Crash with extract from null as date.
> Contributor(s):
> Claudio Varderrama <cvalde at>
>But it is not waht is happening with me...

No, what is happening with you is that you are getting an exception message
from trying to pass a null to EXTRACT(). That was Claudio's fix. An
exception is preferable to a crash. AFAIK, there is not yet any fix
implemented to silently return null under these circumstances, but you
should ask on fb-devel.

>I take another look on source forge bug tracker and did not found anithing
>Did some googling with no sucess...
>But as you said the fellow developers knows what is happening... So I think
>this will be fixed when they have time and oportunity... I think before 1.5
>final release... I have considered it a bug, but post it here to see if
>someone have knowledge about it... And know some workaround...

I guess the only workarounds for Fb 1.0.3 would be to use a selectable SP,
so that you can intercept the nulls and deal with them before calling
EXTRACT()...or to use correlated subqueries instead of the left join.