Subject | Re: [firebird-support] Re: Making evaluation of UDFs constant across a query |
---|---|
Author | Paul Vinkenoog |
Post date | 2011-04-05T08:12:57Z |
Geoff Worboys wrote:
I just ran the following query a number of times:
select timestamp 'now', cast ('now' as timestamp) from rdb$database
About one time in ten, the values differ (the second value being a little higher).
If I swap the columns:
select cast ('now' as timestamp), timestamp 'now' from rdb$database
it's still the CAST (now in the first column) that's sometimes higher.
I'd definitely call this a bug, but maybe someone can explain why it "should be" this way?
Paul Vinkenoog
> RegardingThat very surprising. timestamp '<string>' is supposed to be just shorthand syntax for cast('<string>' as timestamp), so if the result differs, that's rather alarming.
> current_timestamp
> vs cast('now' as timestamp)
> vs timestamp 'now'
>
> I just hit this for myself. After reading the FB v2.1 release
> notes I thought I understood that
> timestamp 'now'
> was the equivalent of
> cast('now' as timestamp)
>
> but after using it in a few places I found it is definitely not
> the same.
I just ran the following query a number of times:
select timestamp 'now', cast ('now' as timestamp) from rdb$database
About one time in ten, the values differ (the second value being a little higher).
If I swap the columns:
select cast ('now' as timestamp), timestamp 'now' from rdb$database
it's still the CAST (now in the first column) that's sometimes higher.
I'd definitely call this a bug, but maybe someone can explain why it "should be" this way?
Paul Vinkenoog