mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 08:09:28 +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 Db.Connected then db.Open;
|
||||||
if not sqltr.Active then sqltr.StartTransaction;
|
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);
|
FSQLBuf := TrimRight(FSQL.Text);
|
||||||
|
|
||||||
if FSQLBuf = '' then
|
if FSQLBuf = '' then
|
||||||
DatabaseError(SErrNoStatement);
|
DatabaseError(SErrNoStatement);
|
||||||
|
|
||||||
|
if not assigned(fcursor) then
|
||||||
|
FCursor := Db.AllocateCursorHandle;
|
||||||
|
|
||||||
SQLParser(FSQLBuf);
|
SQLParser(FSQLBuf);
|
||||||
|
|
||||||
if ServerFiltered then
|
if ServerFiltered then
|
||||||
|
@ -1526,7 +1526,8 @@ begin
|
|||||||
Open;
|
Open;
|
||||||
except
|
except
|
||||||
on E:EDatabaseError do
|
on E:EDatabaseError do
|
||||||
if pos(SErrNoStatement,E.Message) > -1 then PassException := True;
|
if Pos(SErrNoStatement,E.Message) > 0 then
|
||||||
|
PassException := True;
|
||||||
end;
|
end;
|
||||||
AssertTrue(PassException);
|
AssertTrue(PassException);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user