Subject Re: [ib-support] Casting problem
Author Claudio Valderrama C.
"Veli-Matti Hurskainen" <vmh@...> wrote in message
news:5.1.0.14.0.20010811233421.021dfc50@......
> Firebird WI-T0.9.4.41 Firebird Test1 on NT and
> Firebird LI-T0.9.4.34 (p1) Firebird Test1 on Linux.
>
> There might be a small bug:
> Using dialect 1 cast(integer <any operation except multiplying> integer as
> varchar(... returns a floating point or double precision value:
> SQL> select cast(1 + 1 as varchar(9)) from rdb$database;
> =========
> 2.000000

If IB5 does the same thing, then it's okay. Dialect 1 is mostly here to
emulate previous releases of the engine.
At some time, I had to modify FB because multiplication in dialect 1 was
being done in exact numerics and no exception was issued when an overflow
happened, hence people got their data spoiled silently. Hence, I reverted to
the old schema: when there's no room for the exact result, I produce double
precision. So, FB in dialect 1 will behave in sync with IB5. AFAIK, IB still
carries the problem.

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing