I found bag:
Found unneeded code lines for WideString
[patch_done] Loockup error
Moderators: gto, EgonHugeist, olehs
[patch_done] Loockup error
You do not have the required permissions to view the files attached to this post.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Shagrat3,
i don't understand, why these lines are not needed.
I think the whole code is this:
Which means we do also compare nun Unicode-Fields. In my branch both (stUnicodeString/stString) types are valid. stString is for Ansi-Connection or Fields which have a static mask like type 'Mac' or 'IP' of PostgresSQL. stUnicodeString is for unicode Connections and means a UTF8Decoded Wide/UnicodeString.
So please try to teach me, why these lines are waste.
Your toppic also points me to an error. Do you realy have one? Has something changed?
Michael
i don't understand, why these lines are not needed.
I think the whole code is this:
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;
So please try to teach me, why these lines are waste.
Your toppic also points me to an error. Do you realy have one? Has something changed?
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
In picture has:
The unnecessary part of the code corrupts the correct comparison WideString
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;
You do not have the required permissions to view the files attached to this post.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Shagrat3,
you're right! Wondering why these lines are still available. I had removed them from \testing serveral weeks ago.
Patch done Rev 1438 \testing and merged 1439 \testing-egonhugeist
Available on trunk in two weeks.
Thank you for that hint. But the other thread is talking about my branch where these lines do not exsits...
Michael
you're right! Wondering why these lines are still available. I had removed them from \testing serveral weeks ago.
Patch done Rev 1438 \testing and merged 1439 \testing-egonhugeist
Available on trunk in two weeks.
Thank you for that hint. But the other thread is talking about my branch where these lines do not exsits...
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/