Batch insert error when unique constraint is set on multiple attributes

Number:rdar://FB8780731 Date Originated:2020/10/6
Status:Open Resolved:
Product:Core Data Product Version:14
Classification:Bug Reproducible:Yes
Core Data batch insert returns error when batch inserting an entity with unique constraint on multiple attributes.

I have a sample code illustrating the problem:

I expect the insert to goes through. 

My work around of this problem is... create an extra attribute to store the compound key there instead. Obviously this is more error prone. But it's a workaround.

I hope Core Data team can update the documentation or the, better, fix the issue.

The documentation does says we can use coma-separated list in unique constraint.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!