Page 1 of 1
FB: AV with invalid SQL. No correct error message / Exceptio
Posted: 11.05.2009, 14:03
by mscherr
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.
Code: Select all
procedure TZInterbase6PreparedStatement.UnPrepareInParameters;
begin
if assigned(FParamSQLData) then
FParamSQLData.FreeParamtersValues;
inherited UnPrepareInParameters;
end;
Can anyone reproduce this issue?
Regard,
Michael
Posted: 12.05.2009, 21:01
by seawolf
Can you provide an example which permit us to reproduce the problem you did?
Thank you
Posted: 13.05.2009, 21:16
by mdaems
This change looks reasonable without a test case. So I committed this to testing branch. (Rev 638)
Mark
Posted: 14.05.2009, 10:00
by mscherr
Thank!
I had the problem with any invalid sql-command.
TZQuery + TZConnection connected to a firebird 2 server:
select * from existingtablename
= OK
select * from notexistingtablename
= AV
The debugger always stopped twice at this point. The 1st time with FParamSQLData assigned, the 2nd time with FParamSQLData=nil.
Now I get the correct firebird error message.
Posted: 14.05.2009, 12:21
by mdaems
The debugger always stopped twice at this point.
Big question : is this twice for the same Object or not? Maybe we must check the call stacks to see why it's executed twice.
Mark
Posted: 21.05.2009, 06:38
by seawolf
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?
Posted: 23.05.2009, 13:49
by mdaems
seawolf,
Who are you asking this question?
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...
Mark
Posted: 23.05.2009, 14:24
by seawolf
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.
Anyway I've not applied that patch yet.
Posted: 26.05.2009, 09:48
by mscherr
Well, I don't know if this is or should be the normal behavior.
MadExpect gave me the callstack of the problem and placing a breakpoint and executing a simple sql query to a not existing table gave me 2 stops...
Posted: 26.05.2009, 17:52
by seawolf
Really sorry, what I wrote was not clear.
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?
Posted: 28.05.2009, 07:14
by mscherr
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.