I have a Delphi database application that is currently running on FB 2.5 server. Application was working OK for several years on previous FB versions. I switched
to FB 2.5 early when it was released.
This year I noticed a couple of cases when there was "INF" value written in double precision field in database. I also noticed, that Delphi Try / Except / End
block was not catching EZeroDivide etc. exceptions. This is big problem.
Imagine a case like this:
C := A / B; // B is zero here
C := 0;
Exception is not raised on C calculation and C is calculated as INF "infinity" number.
Well: I can change that and check if B is zero and do workaround, but there is Delphi VCL that depends on exception being raised!
By default, Delphi sets FPU Control Word to raise exceptions.
You can read more about that here:
So, when I was looking for DLL that my application loads that disables FPU exceptions, I realised that it is Firebird Client library or its MSVC RTL.
Every time you connect to a database, all exceptions are disabled. You execute a query, and all exceptions are disabled.
What I found out is that my Delphi application catches exceptions, working ok, if I use FB client from version 1.5 up to version 2.1.4.
With Fbclient.dll 2.5 there are problems.
¿Is FB Client that is builded with disabled FPU exceptions catching or is it MSVC RTL?. I dont know if MSVC RTL changed from FB 2.1.4 to FB 2.5 or it is the same.
If I set FPU control manualy in my application it works only for a couple of lines, until another "Select..." of code, and it is back disabled again, so this is not a solution.
Currently I am using 2.1.4 client to be on the safe side.