mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 20:49:49 +02:00
fcl-db: sqldb: when parsing SQL end of /* comment */ is not detected if ends with **/. Bug #30171
git-svn-id: trunk@33761 -
This commit is contained in:
parent
57f93ed40d
commit
33d48897d7
@ -257,14 +257,17 @@ begin
|
||||
if p^='*' then // /* */ comment
|
||||
begin
|
||||
Result := True;
|
||||
repeat
|
||||
Inc(p);
|
||||
Inc(p);
|
||||
while p^ <> #0 do
|
||||
begin
|
||||
if p^='*' then // possible end of comment
|
||||
begin
|
||||
Inc(p);
|
||||
if p^='/' then Break; // end of comment
|
||||
end;
|
||||
until p^=#0;
|
||||
end
|
||||
else
|
||||
Inc(p);
|
||||
end;
|
||||
if p^='/' then Inc(p); // skip final /
|
||||
end;
|
||||
end;
|
||||
|
@ -145,6 +145,8 @@ begin
|
||||
// Bracketed comment
|
||||
AssertEquals( 'select * from table where id=/*comment :c*/$1-$2',
|
||||
Params.ParseSQL('select * from table where id=/*comment :c*/:a-:b', True, True, True, psPostgreSQL));
|
||||
AssertEquals( 'select * from table where id=/*comment :c**/$1-$2',
|
||||
Params.ParseSQL('select * from table where id=/*comment :c**/:a-:b', True, True, True, psPostgreSQL));
|
||||
// Consecutive comments, with quote in second comment
|
||||
AssertEquals( '--c1'#10'--c'''#10'select '':a'' from table where id=$1',
|
||||
Params.ParseSQL('--c1'#10'--c'''#10'select '':a'' from table where id=:id', True, True, True, psPostgreSQL));
|
||||
|
Loading…
Reference in New Issue
Block a user