mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 21:29:26 +02:00
* Moved some code to avoid problems while handling exceptions
git-svn-id: trunk@12512 -
This commit is contained in:
parent
8922c3e310
commit
d6903a4bb6
@ -919,11 +919,17 @@ begin
|
||||
if FSQLBuf = '' then
|
||||
DatabaseError(SErrNoStatement);
|
||||
|
||||
SQLParser(FSQLBuf);
|
||||
|
||||
// There may no error occur between the allocation of the cursor and
|
||||
// the preparation of the cursor. Because internalclose (which is called in
|
||||
// case of an exception) assumes that allocated cursors are also prepared,
|
||||
// and thus calls unprepare.
|
||||
// A call to unprepare while the cursor is not prepared at all can lead to
|
||||
// unpredictable results.
|
||||
if not assigned(fcursor) then
|
||||
FCursor := Db.AllocateCursorHandle;
|
||||
|
||||
SQLParser(FSQLBuf);
|
||||
|
||||
if ServerFiltered then
|
||||
Db.PrepareStatement(Fcursor,sqltr,AddFilter(FSQLBuf),FParams)
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user