Subject The predicate where table1.timestamp1 > coalesce(table2.timestamp1, table2.timestamp2, '1.1.2006') does not work since Firebird 2.1
Author Andrew
Hello.

Recently I have migrated my application from Firebird 2.0 to 2.1. Then
the query like this stop working:

select 1 from table1 h inner join table2 z on h.timezone_id = z.id
where h.log_tsc > coalesce(z.upd_tsc, z.create_tsc, '1.1.2006')

It causes the error: "GDS Exception. 335544321. arithmetic exception,
numeric overflow, or string truncation"

The fields h.log_tsc, z.upd_tsc and z.create_tsc are TIMESTAMPs. The
query works if I replace '1.1.2006' to CURRENT_TIMESTAMP-3.
And it works if I use explicit CAST: "where h.log_tsc >
coalesce(z.upd_tsc, z.create_tsc, cast('1.1.2006' as TIMESTAMP))"
Please clarify the situation.

Regards,

Andrew.