I'm using the latest ZEOS from the SVN from today.
Also in the version before that, I always had the problem, that I never got a meanfull error message when I entered a invalid SQL command. Instead I got a AV in the ZEOS sources.
I was able to fix it by adding a check if FParamSQLData is assigned as is was nil when the AV happened.
procedure TZInterbase6PreparedStatement.UnPrepareInParameters;
begin
if assigned(FParamSQLData) then
FParamSQLData.FreeParamtersValues;
inherited UnPrepareInParameters;
end;
I wrote a test in order to verify that problem, but I noted that the procedure TZInterbase6PreparedStatement.UnPrepareInParameters is called before an exception (sInvalid ..) is raised. Is it correct?
Were you able to write a test suite case failing because of this issue (without the patch applied)? In that case I might help testing to see why the Unprepare is called twice. My first impression is that it's just normal error handling (= make sure everything's cleaned up), but better be sure...
I wrote a test in order to understand why UnPrepareInParameters is called 2 times (as stated). But, it seems, UnPrepareInParameters is called after a Sinvalid .. exception is raised.
So my question to mscherr is if this is the normal behaviour or I something is wrong.
My question was not related Zeos normal behaviour, but when you had that error, an exception was raised, your software continue and afterDo you have the problem on UnPrepareInParameters?
Or no exceptions were raised and Do you have the problem related to UnPrepareInParameters?
An AV was raised cause of the nil pointer. MadExcept (an AddOn for Delphi to catch and report exceptions in applications like Eureka Log) catched the AV and gave me the callstack where it happended. With ME turned off the app gave me the AV and stopped.
Like I said: After ME gave me the unit, method and line of code, I placed a breakpoint. It stopped twice, 1st time with the pointer assigned, 2nd time with pointer=nil.