mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 22:29:24 +02:00
+ Fixed a crash when connecting to a database fails when using execsql on a query
git-svn-id: trunk@3829 -
This commit is contained in:
parent
fb9f8bb2a1
commit
90b40e9385
@ -973,7 +973,9 @@ begin
|
||||
Prepare;
|
||||
Execute;
|
||||
finally
|
||||
if (not IsPrepared) and (assigned(database)) then (database as TSQLConnection).UnPrepareStatement(Fcursor);
|
||||
// FCursor has to be assigned, or else the prepare went wrong before PrepareStatment was
|
||||
// called, so UnPrepareStatement shoudn't be called either
|
||||
if (not IsPrepared) and (assigned(database)) and (assigned(FCursor)) then (database as TSQLConnection).UnPrepareStatement(Fcursor);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user