From c7dcb1d808597e0806fb352bb5ddc4b58c452f4c Mon Sep 17 00:00:00 2001 From: Anssi Kääriäinen Date: Sat, 24 Nov 2012 00:28:20 +0200 Subject: [1.4.x] Fixed SQLite's collapsing of same-valued instances in bulk_create SQLite used INSERT INTO tbl SELECT %s UNION SELECT %s, the problem was that there should have been UNION ALL instead of UNION. Refs #19351 Backpatch of a27582484cf814554907d2d1ad077852de36963f --- django/db/backends/sqlite3/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django') diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index 2146a7fa8a..f31d2ab3eb 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -215,7 +215,7 @@ class DatabaseOperations(BaseDatabaseOperations): res.append("SELECT %s" % ", ".join( "%%s AS %s" % self.quote_name(f.column) for f in fields )) - res.extend(["UNION SELECT %s" % ", ".join(["%s"] * len(fields))] * (num_values - 1)) + res.extend(["UNION ALL SELECT %s" % ", ".join(["%s"] * len(fields))] * (num_values - 1)) return " ".join(res) class DatabaseWrapper(BaseDatabaseWrapper): -- cgit v1.3