#1 2025-09-24 19:16:46

tbo
Member
Registered: 2015-04-20
Posts: 375

Unexpected result with DynArrayEquals

Delphi 12.2
mORMot 2, Commit 2.3.11508

In the following test, I would have expected the result "True", but got "False". Where is the error?

var
  va1, va2: TVariantDynArray;
begin
  SetLength(va1, 2);
  va1[0] := 'true';
  va1[1] := 'false';
  SetLength(va2, 2);
  va2[0] := 'True';
  va2[1] := 'False';
  ShowMessage(DynArrayEquals(TypeInfo(TVariantDynArray), va1, va2, Nil, Nil, {CaseInsensitive=}True).ToString(TUseBoolStrs.True));

It works with TRawUtf8DynArray.

With best regards
Thomas

Offline

#2 2025-09-24 20:01:01

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,240
Website

Re: Unexpected result with DynArrayEquals

On my PC, the test passes with FPC:
https://github.com/synopse/mORMot2/commit/39ba5f1

I will try tomorrow with Delphi.
Perhaps it is an UnicodeString thing.

Edit:
I tried to reproduce it with UnicodeString, and no issue:
https://github.com/synopse/mORMot2/commit/b4f2c3c7b
But I don't have Delphi 12 here - just Delphi 2010 and Delphi XE7.

Offline

#3 2025-09-26 21:34:13

tbo
Member
Registered: 2015-04-20
Posts: 375

Re: Unexpected result with DynArrayEquals

I can confirm that with mORMot 2, Commit 2.3.12684, it runs with the following Delphi versions: Delphi 10.2, Delphi 10.3, Delphi 10.4, Delphi 11.3, Delphi 12.3, Delphi 13.0.

I will test it with the latest mORMot version and Delphi 12.2 on Monday. It may be that we only need to update our mORMot version in the production version. I'm sorry I didn't test it beforehand.

With best regards
Thomas

Offline

#4 2025-09-29 08:52:11

tbo
Member
Registered: 2015-04-20
Posts: 375

Re: Unexpected result with DynArrayEquals

I can confirm that it also works as desired with Delphi 12.2 and mORMot2 Commit 2.3.12685. The error has been fixed between Commit 2.3.11508 and 2.3.12685.

With best regards
Thomas

Offline

Board footer

Powered by FluxBB