Problem with FixString in SqlQueryParameterFixer

Hi

If I have command set to 'insert into employees(id,name) values(@id,@name)

the fixstring method changes the sql to 'insert into employees(id,name) values($1$2)

It looks like it shouldnt inc after calling aReplacer.

Cheers,
John

This seems to work

      while i < aString.Length do begin
        var callInc := true;
        
        case aString[i] of
          '@': if lQuoteChar <> #0 then lSQ.Append(aString[i]) else begin
            inc(i);
            var lStart := i;
            while i < aString.Length do begin
              if aString[i] in ['a'..'z', 'A'..'Z', '0'..'9', '_'] then begin
                inc(i);
              end else break;
            end;
            lSQ.Append(aReplacer(aString.Substring(lStart, i - lStart)));
            callInc := false;
          end;
          '"', '`', '''': begin
            if lQuoteChar = aString[i] then lQuoteChar := #0 else
              if lQuoteChar = #0 then lQuoteChar := aString[i];
            lSQ.Append(aString[i])
          end;
          else
            lSQ.Append(aString[i])
          end;
        if(callInc)then
        begin
          inc(i);
        end;
      end;

Logged as bugs://E25580.

This is what I think is wrong

1 Like

thanx, can you submit pull requests for these? :pray:t3:

Thanks

2 Likes

Nice one! Thanks!

Besides these changes everything working well for you with IslandDB now?

1 Like

bugs://E25580 was closed as fixed.

1 Like

Yes thanks

1 Like