Skip to content

Commit

Permalink
Fixed #35655 -- Reverted "Fixed #35295 -- Used INSERT with multiple r…
Browse files Browse the repository at this point in the history
…ows on Oracle 23c."

This reverts commit 175b049 due to a crash when Oracle > 23.3.
  • Loading branch information
sarahboyce committed Aug 3, 2024
1 parent 6d3464c commit 5424151
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
4 changes: 0 additions & 4 deletions django/db/backends/oracle/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,6 @@ def supports_comparing_boolean_expr(self):
def supports_aggregation_over_interval_types(self):
return self.connection.oracle_version >= (23,)

@cached_property
def supports_bulk_insert_with_multiple_rows(self):
return self.connection.oracle_version >= (23,)

@cached_property
def bare_select_suffix(self):
return "" if self.connection.oracle_version >= (23,) else " FROM DUAL"
18 changes: 0 additions & 18 deletions django/db/backends/oracle/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,24 +678,6 @@ def bulk_insert_sql(self, fields, placeholder_rows):
for field in fields
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 = []
for row in placeholder_rows:
select = []
Expand Down

0 comments on commit 5424151

Please sign in to comment.