[patch_done] Loockup error
Posted: 03.07.2012, 11:17
I found bag:
Found unneeded code lines for WideString
Found unneeded code lines for WideString
This is the official forum of ZeosLib providing support to all ZeosLib users.
https://zeoslib.sourceforge.io/
Code: Select all
if PartialKey then
begin
if CurrentType = stUnicodeString then
begin
WValue1 := KeyValues[I].VUnicodeString;
WValue2 := ResultSet.GetUnicodeString(ColumnIndex);
if CaseInsensitive then
WValue2 := WideUpperCase(WValue2);
{$IFDEF DELPHI12_UP}
Result := SysUtils.AnsiStrLComp(PWideChar(WValue2), PWideChar(WValue1), Length(WValue1)) = 0;
{$ELSE}
AValue1 := UTF8ToAnsi(UTF8Encode(WValue1));
AValue2 := UTF8ToAnsi(UTF8Encode(WValue2));
Result := AnsiStrLComp(PAnsiChar(AValue2), PAnsiChar(AValue1), Length(AValue1)) = 0;
{$ENDIF}
end
else //-> AnsiStringData or other string-compatible data-fields
begin
AValue1 := AnsiString(KeyValues[I].VString);
AValue2 := AnsiString(ResultSet.GetString(ColumnIndex));
if CaseInsensitive then
{$IFDEF LAZARUSUTF8HACK}
AValue2 := AnsiUpperCase(Utf8ToAnsi(AValue2));
{$ELSE}
AValue2 := {$IFDEF DELPHI12_UP}AnsiStrings.{$ENDIF}AnsiUpperCase(AValue2);
{$ENDIF}
Result := AnsiStrLComp(PAnsiChar(AValue2), PAnsiChar(AValue1), Length(AValue1)) = 0;
end;
Code: Select all
if CaseInsensitive then
{$IFDEF LAZARUSUTF8HACK}
AValue2 := AnsiUpperCase(Utf8ToAnsi(AValue2));
{$ELSE}
AValue2 := {$IFDEF DELPHI12_UP}AnsiStrings.{$ENDIF}AnsiUpperCase(AValue2);
{$ENDIF}
Result := AnsiStrLComp(PAnsiChar(AValue2), PAnsiChar(AValue1), Length(AValue1)) = 0;
end;