mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 10:29:17 +02:00
fcl-db: postgresql: Fix AV in UnprepareStatement (TPQCursor.tr is nil).
Revealed by TTestTSQLQuery.TestKeepOpenOnCommit. Commit destroys TPQTrans object, which in destructor sets tr:=nil for all registered cursors. So attempt to Close TSQLQuery after Commit has leading to AV. git-svn-id: trunk@29507 -
This commit is contained in:
parent
d24382e8f8
commit
d8ce1caea3
@ -953,7 +953,7 @@ begin
|
||||
res:=nil;
|
||||
if FPrepared then
|
||||
begin
|
||||
if PQtransactionStatus(tr.PGConn) <> PQTRANS_INERROR then
|
||||
if assigned(tr) and (PQtransactionStatus(tr.PGConn) <> PQTRANS_INERROR) then
|
||||
begin
|
||||
res := PQexec(tr.PGConn,pchar('deallocate '+StmtName));
|
||||
CheckResultError(res,nil,SErrUnPrepareFailed);
|
||||
|
Loading…
Reference in New Issue
Block a user