* Patch from Ladislav Karrach to parse queries with the limit keyword, bug #15456

git-svn-id: trunk@15196 -
This commit is contained in:
joost 2010-04-28 21:13:23 +00:00
parent 845125c2e7
commit 6ba6be6b2b

View File

@ -1137,7 +1137,7 @@ begin
end;
end;
ppFrom : begin
if (s = 'WHERE') or (s = 'ORDER') or (s = 'GROUP') or (CurrentP^=#0) or (CurrentP^=';') then
if (s = 'WHERE') or (s = 'ORDER') or (s = 'GROUP') or (s = 'LIMIT') or (CurrentP^=#0) or (CurrentP^=';') then
begin
if (s = 'WHERE') then
begin
@ -1154,6 +1154,11 @@ begin
ParsePart := ppOrder;
StrLength := PhraseP-PStatementPart
end
else if (s = 'LIMIT') then
begin
ParsePart := ppBogus;
StrLength := PhraseP-PStatementPart
end
else
begin
ParsePart := ppBogus;
@ -1180,11 +1185,11 @@ begin
end;
end;
ppWhere : begin
if (s = 'ORDER') or (s = 'GROUP') or (CurrentP^=#0) or (CurrentP^=';') then
if (s = 'ORDER') or (s = 'GROUP') or (s = 'LIMIT') or (CurrentP^=#0) or (CurrentP^=';') then
begin
ParsePart := ppBogus;
FWhereStartPos := PStatementPart-PSQL;
if (s = 'ORDER') or (s = 'GROUP') then
if (s = 'ORDER') or (s = 'GROUP') or (s = 'LIMIT') then
FWhereStopPos := PhraseP-PSQL+1
else
FWhereStopPos := CurrentP-PSQL+1;