related_objects() fails on SQLite when passing more than 999 objects
|Reported by:||NiGhTTraX||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Severity:||Normal||Keywords:||sqlite delete related 999|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Using SQLite, trying to delete objects that have more than 999 related objects will fail with a 'too many SQL variables' error. This is due to the related_objects() method getting all the related objects in one query.
I've written a patch to fetch the related objects in batches using the bulk_batch_size database ops. You can check it here:
Also added a new test to check for this new behavior.
All comments are welcome.