mirror of
https://github.com/django/django.git
synced 2025-04-01 03:56:42 +00:00
This reverts commit 175b04942afaff978013db61495f3b39ea12989b due to a crash when Oracle > 23.3. Backport of 5424151f96252e1289e9a6f7eb842cd1dc87850a from main.
This commit is contained in:
parent
55f5292701
commit
03051db758
@ -204,10 +204,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
|||||||
def supports_aggregation_over_interval_types(self):
|
def supports_aggregation_over_interval_types(self):
|
||||||
return self.connection.oracle_version >= (23,)
|
return self.connection.oracle_version >= (23,)
|
||||||
|
|
||||||
@cached_property
|
|
||||||
def supports_bulk_insert_with_multiple_rows(self):
|
|
||||||
return self.connection.oracle_version >= (23,)
|
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def bare_select_suffix(self):
|
def bare_select_suffix(self):
|
||||||
return "" if self.connection.oracle_version >= (23,) else " FROM DUAL"
|
return "" if self.connection.oracle_version >= (23,) else " FROM DUAL"
|
||||||
|
@ -678,24 +678,6 @@ END;
|
|||||||
for field in fields
|
for field in fields
|
||||||
if field
|
if field
|
||||||
]
|
]
|
||||||
if (
|
|
||||||
self.connection.features.supports_bulk_insert_with_multiple_rows
|
|
||||||
# A workaround with UNION of SELECTs is required for models without
|
|
||||||
# any fields.
|
|
||||||
and field_placeholders
|
|
||||||
):
|
|
||||||
placeholder_rows_sql = []
|
|
||||||
for row in placeholder_rows:
|
|
||||||
placeholders_row = (
|
|
||||||
field_placeholder % placeholder
|
|
||||||
for field_placeholder, placeholder in zip(
|
|
||||||
field_placeholders, row, strict=True
|
|
||||||
)
|
|
||||||
)
|
|
||||||
placeholder_rows_sql.append(placeholders_row)
|
|
||||||
return super().bulk_insert_sql(fields, placeholder_rows_sql)
|
|
||||||
# Oracle < 23c doesn't support inserting multiple rows in a single
|
|
||||||
# statement, use UNION of SELECTs as a workaround.
|
|
||||||
query = []
|
query = []
|
||||||
for row in placeholder_rows:
|
for row in placeholder_rows:
|
||||||
select = []
|
select = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user