mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
[1.5.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 a27582484c
This commit is contained in:
@@ -227,7 +227,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):
|
||||
|
||||
Reference in New Issue
Block a user