You are not logged in.
Hello,
today I have discovered that commit https://synopse.info/fossil/info/888baa599a51ab0a broke functionality of SynDB.TSQLDBStatementWithParamsAndColumns.ColumnIndex() method - it never finds a column, because it compares TSQLDBColumnProperty records by pointers.
Regards,
Joe
Offline
With which compiler?
Found with Delphi 10.3.1
Offline
Ok, I have analyzed it a bit more. The problem is that extended RTTI used in the TDynArray.ToKnownType() method it returns djCustom and thus the comparison fails to dig deeper (to compare first string elem of record). I have patched it this way:
{$ifdef ISDELPHI2010} // seems inconsistent with FPC - only for Delphi 2010+
- if (result=djNone) and (fElemType2<>nil) then // try from extended RTTI
+ if (result=djNone) and (fElemType2<>nil) and not (PTypeKind(fElemType2)^ in [tkClass, tkInterface, tkRecord, tkArray, tkDynArray]) then begin // try from extended RTTI
result := RTTI[TJSONCustomParserRTTI.TypeInfoToSimpleRTTIType(fElemType2)];
+ if result = djCustom then // unknown types
+ Result:= djNone;
end;
{$endif}
Offline
This is weird because TypeInfoToSimpleRTTIType() returns indeed ptCustom, but RTTI[ptCustom] returns djNone in my computer (with Delphi 10.3).
So result should never be djCustom anyway.
I have made a deeper refactoring to avoid issues as you discovered.
Please check https://synopse.info/fossil/info/51eced20b8
Online
I have made a deeper refactoring to avoid issues as you discovered.
Please check https://synopse.info/fossil/info/51eced20b8
It is working perfectly now (I have removed that dirty patch of mine). Thanks.
Offline