Potential bug in v10

Hit a problem when we upgraded to v10 from v9 which took a while to track down.

The issue is in uDALocalDataAdapter.TDALocalDataStreamer.DoBeginWriteDataset

The lFldList variable used to be a TStringList but now, assuming ROUseGenerics is defined, is a TDictionary.

We were experiencing an issue because TStringList isn’t case sensitive but TDictionary is. It was failing to find a field because the case differed. The field was simply called “Id” but it was trying to match with “id”.

We tracked this down to the schema, where the field in question was capitalised correctly as “Id” in the fields list but, in the mappings table, was showing as lowercase “id” for all three columns.

Now I don’t know how this happened as I can’t find any way of making the field name in the fields list different to the Schema Table Field in the mappings table. You can’t change it directly in the mappings and changing the field name immediately updates the mappings entry.

That said, they were different and the table in question was added to the schema years ago so it’s possible this was the result of an old bug, possibly where the original database field wasn’t capitalised correctly, pulled into the schema and then the capitalisation was fixed in the field name but not updated in the mappings. An old bug that’s since been fixed perhaps?

Correcting this capitalisation has cured the problem but I’m flagging this as it could potentially hit other people.

Whilst the capitalisation between the field name and the mapping should always been the same, there are obviously situations where it may not be and, in those cases, changing a non case sensitive TStringList to a case sensitive TDictionary becomes a breaking change.


Thx for report.
it can be fixed via updating that line to

      lFldList:={$IFDEF ROUseGenerics}TDictionary<String,Integer>.Create(TIStringComparer.Ordinal){$ELSE}TStringList.Create{$ENDIF};

Thanks, logged as bugs://84044

bugs://84044 got closed with status fixed.

Thanks. System.Generics.Defaults also needs adding to the uses clause