MarkMpn / Sql4Cds

SQL 4 CDS core engine and XrmToolbox tool
MIT License
74 stars 22 forks source link

Number of records impacted by delete displays 0 records #464

Closed n0rthface closed 4 months ago

n0rthface commented 4 months ago

Hi Mark,

I just discovered this minor issue in SQL 4 CDS v9.0. When I delete any number of records, the number of impacted records in the "Messages" tab equals to 0 in any case after the operation has finished. The number of records is correct for insert and update statements.

image

image

image

Best regards Hauke

MarkMpn commented 4 months ago

I haven't been able to reproduce this yet. The only expected case for these numbers to be different is if those records are deleted by some other process before SQL 4 CDS can delete them.

Can you check:

  1. Are the records still there, or have they been deleted
  2. If they have been deleted, is there any chance they were deleted by some other process between you getting the confirmation message and the query completing?
  3. If the records are still there, do you get an error message if you try to delete them using some other means?
n0rthface commented 4 months ago

I just tested as per your request and the issue still persists for deleted records only. The records are deleted successfully by issueing the delete statement in SQL 4 CDS. No other process interferes with the delete. When deleting a record from the same table in model driven app, the request returns with status code 204 (no content) in the same way as an update request. I uninstalled and installed SQL 4 CDS 9.0, but unfortunately there is no change to the behavior.

MarkMpn commented 4 months ago

I think I’ve now isolated the cause of this. If you change your maximum batch size setting to 1 you should get the correct number of records reported. I’ll try to get a fix out for this shortly.

n0rthface commented 4 months ago

Thanks for your effort. I confirm that number of records is returned correctly when deleting with batch size equals to 1.