* 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:
joost 2009-01-05 12:23:54 +00:00
parent 3657380e77
commit 8922c3e310
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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;