mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 15:49:26 +02:00
* Check for an empty statement before the cursor is allocated so that the right error message is shown. (+test which was committed partly in r12510 already)
git-svn-id: trunk@12511 -
This commit is contained in:
parent
3657380e77
commit
8922c3e310
@ -914,15 +914,14 @@ begin
|
||||
if not Db.Connected then db.Open;
|
||||
if not sqltr.Active then sqltr.StartTransaction;
|
||||
|
||||
// if assigned(fcursor) then FreeAndNil(fcursor);
|
||||
if not assigned(fcursor) then
|
||||
FCursor := Db.AllocateCursorHandle;
|
||||
|
||||
FSQLBuf := TrimRight(FSQL.Text);
|
||||
|
||||
if FSQLBuf = '' then
|
||||
DatabaseError(SErrNoStatement);
|
||||
|
||||
if not assigned(fcursor) then
|
||||
FCursor := Db.AllocateCursorHandle;
|
||||
|
||||
SQLParser(FSQLBuf);
|
||||
|
||||
if ServerFiltered then
|
||||
|
@ -1526,7 +1526,8 @@ begin
|
||||
Open;
|
||||
except
|
||||
on E:EDatabaseError do
|
||||
if pos(SErrNoStatement,E.Message) > -1 then PassException := True;
|
||||
if Pos(SErrNoStatement,E.Message) > 0 then
|
||||
PassException := True;
|
||||
end;
|
||||
AssertTrue(PassException);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user