File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3553,13 +3553,11 @@ class function TSQLBatch.GetSQLWithoutComments(FullSQL: String): String;
35533553 Result := ' ' ;
35543554 InLineComment := False;
35553555 InMultiLineComment := False;
3556- Prev1 := #0 ;
3557- Prev2 := #0 ;
35583556 for i:=1 to Length(FullSQL) do begin
35593557 Cur := FullSQL[i];
35603558 AddCur := True;
3561- if i > 1 then Prev1 := FullSQL[i-1 ];
3562- if i > 2 then Prev2 := FullSQL[i-2 ];
3559+ if i > 1 then Prev1 := FullSQL[i-1 ] else Prev1 := # 0 ;
3560+ if i > 2 then Prev2 := FullSQL[i-2 ] else Prev2 := # 0 ;
35633561
35643562 if (Cur = ' *' ) and (Prev1 = ' /' ) then begin
35653563 InMultiLineComment := True;
@@ -3578,7 +3576,7 @@ class function TSQLBatch.GetSQLWithoutComments(FullSQL: String): String;
35783576 else if Cur = ' #' then begin
35793577 InLineComment := True;
35803578 end
3581- else if (Cur = ' ' ) and (Prev1 = ' -' ) and (Prev2 = ' -' ) then begin
3579+ else if (not InLineComment) and ( Cur = ' ' ) and (Prev1 = ' -' ) and (Prev2 = ' -' ) then begin
35823580 InLineComment := True;
35833581 System.Delete(Result, Length(Result)-1 , 2 ); // Delete comment chars
35843582 end ;
You can’t perform that action at this time.
0 commit comments