mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Adjust offset stuff in SQL splitter routine, DELIMITER department. Fixes issue #2053.
This commit is contained in:
@ -379,9 +379,9 @@ begin
|
|||||||
DelimLen := Length(Delim);
|
DelimLen := Length(Delim);
|
||||||
Result := TSQLBatch.Create;
|
Result := TSQLBatch.Create;
|
||||||
rx := TRegExpr.Create;
|
rx := TRegExpr.Create;
|
||||||
rx.Expression := '^\s*DELIMITER\s+(\S+)\s*$';
|
rx.Expression := '^\s*DELIMITER\s+(\S+)\s*';
|
||||||
rx.ModifierI := True;
|
rx.ModifierI := True;
|
||||||
rx.ModifierM := True;
|
rx.ModifierM := False;
|
||||||
while i < AllLen do begin
|
while i < AllLen do begin
|
||||||
Inc(i);
|
Inc(i);
|
||||||
// Current and next char
|
// Current and next char
|
||||||
@ -405,10 +405,10 @@ begin
|
|||||||
if (CharInSet(c, NewLines) and (not CharInSet(n, NewLines))) or (i = 1) then begin
|
if (CharInSet(c, NewLines) and (not CharInSet(n, NewLines))) or (i = 1) then begin
|
||||||
if i > 1 then
|
if i > 1 then
|
||||||
InComment := False;
|
InComment := False;
|
||||||
if (not InString) and (not InBigComment) and rx.Exec(copy(SQL, LastLeftOffset, 100)) then begin
|
if (not InString) and (not InBigComment) and rx.Exec(copy(SQL, i, 100)) then begin
|
||||||
Delim := rx.Match[1];
|
Delim := rx.Match[1];
|
||||||
DelimLen := Length(Delim);
|
DelimLen := rx.MatchLen[1];
|
||||||
Inc(i, rx.MatchLen[0]+1);
|
Inc(i, rx.MatchLen[0]);
|
||||||
LastLeftOffset := i;
|
LastLeftOffset := i;
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user