1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

[1.5.x] Fixed #19351 -- SQLite bulk_insert of more than 500 single-field objs

Backpatch of 0a0a0d66b3
This commit is contained in:
Anssi Kääriäinen
2012-11-24 00:44:48 +02:00
parent 625dc3f072
commit 421e599ad3
2 changed files with 13 additions and 1 deletions

View File

@@ -102,6 +102,14 @@ class BulkCreateTests(TestCase):
101)
self.assertEqual(TwoFields.objects.filter(f2__gte=901).count(), 101)
@skipUnlessDBFeature('has_bulk_insert')
def test_large_single_field_batch(self):
# SQLite had a problem with more than 500 UNIONed selects in single
# query.
Restaurant.objects.bulk_create([
Restaurant() for i in range(0, 501)
])
@skipUnlessDBFeature('has_bulk_insert')
def test_large_batch_efficiency(self):
with override_settings(DEBUG=True):