Renaming dataset fails disgracefully when one of the field nat not be auto-renamed
Original Reporter info from Mantis: Ask
-
Reporter name: Alexander S. Klenin
Original Reporter info from Mantis: Ask
- Reporter name: Alexander S. Klenin
Description:
TDataset.SetName procedure auto-renames fields to prefix
them with the new dataset name instead of old.
If one of the fields fails to change name (most probably
because it will lead to a duplicate),
the exception is thrown and the whole renaming aborts.
This results in two problems:
- Auto-renamings stops, even if only one field can not be renamed,
with half of fields renamed and half not renamed.
- When using Lazaurs, Object Inspector thinks that renaming failed
and does not update, leading user to believe that the dataset was not
renamed, when in fact it was.
I suggest to catch EComponentError, collect failed fields,
and rethrow the exception at the end of procedure.
Then, Lazarus may be modified to catch that exception
and update the interface despite displaying the error.
Mantis conversion info:
- Mantis ID: 18672
- Fixed in version: 3.1.1
- Fixed in revision: 39470 (#270cf0ed)
- Target version: 3.2.0