mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 10:19:19 +02:00
fcl-db: sqldb: fixes AV when SQL is empty, Cursor is not allocated yet. Bug #29124
git-svn-id: trunk@32566 -
This commit is contained in:
parent
8df979e5e8
commit
6f9d542d81
@ -1228,11 +1228,11 @@ begin
|
|||||||
if not ATransaction.Active then
|
if not ATransaction.Active then
|
||||||
ATransaction.MaybeStartTransaction;
|
ATransaction.MaybeStartTransaction;
|
||||||
|
|
||||||
try
|
SQL := TrimRight(SQL);
|
||||||
SQL := TrimRight(SQL);
|
if SQL = '' then
|
||||||
if SQL = '' then
|
DatabaseError(SErrNoStatement);
|
||||||
DatabaseError(SErrNoStatement);
|
|
||||||
|
|
||||||
|
try
|
||||||
Cursor := AllocateCursorHandle;
|
Cursor := AllocateCursorHandle;
|
||||||
Cursor.FStatementType := stUnknown;
|
Cursor.FStatementType := stUnknown;
|
||||||
If LogEvent(detPrepare) then
|
If LogEvent(detPrepare) then
|
||||||
|
Loading…
Reference in New Issue
Block a user