Opened 8 months ago

Closed 8 months ago

Last modified 3 months ago

#35295 closed Cleanup/optimization (wontfix)

Use INSERT with multiple rows on Oracle 23c+

Reported by: Mariusz Felisiak Owned by: Mariusz Felisiak
Component: Database layer (models, ORM) Version: 5.0
Severity: Normal Keywords: oracle
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Oracle 23c finally allows to INSERT multiple rows into a table in a single step without a UNION-SELECT workaround 🎉

https://oracle-base.com/articles/23c/table-values-constructor-23c#insert

Change History (10)

comment:1 by Mariusz Felisiak, 8 months ago

Has patch: set

comment:2 by David Smith, 8 months ago

Triage Stage: UnreviewedAccepted

comment:3 by Mariusz Felisiak, 8 months ago

Patch needs improvement: set

The current patch fails on field_defaults.tests.DefaultTests.test_bulk_create_mixed_db_defaults_function:

django.db.utils.DatabaseError: ORA-01797: this operator must be followed by ANY or ALL

comment:4 by GitHub <noreply@…>, 8 months ago

In 33c06ca0:

Refs #32673, Refs #35295 -- Avoided wrapping rhs direct values in lookups.

comment:5 by Mariusz Felisiak, 8 months ago

Patch needs improvement: unset

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 8 months ago

In 912f72a:

Refs #35295 -- Added BaseDatabaseOperations.bulk_insert_sql().

Co-authored-by: Nick Pope <nick@…>

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 8 months ago

Resolution: fixed
Status: assignedclosed

In 175b049:

Fixed #35295 -- Used INSERT with multiple rows on Oracle 23c.

comment:8 by Sarah Boyce <42296566+sarahboyce@…>, 3 months ago

In 5424151:

Fixed #35655 -- Reverted "Fixed #35295 -- Used INSERT with multiple rows on Oracle 23c."

This reverts commit 175b04942afaff978013db61495f3b39ea12989b due to a crash when Oracle > 23.3.

comment:9 by Sarah Boyce <42296566+sarahboyce@…>, 3 months ago

In 03051db:

[5.1.x] Fixed #35655 -- Reverted "Fixed #35295 -- Used INSERT with multiple rows on Oracle 23c."

This reverts commit 175b04942afaff978013db61495f3b39ea12989b due to a crash when Oracle > 23.3.

Backport of 5424151f96252e1289e9a6f7eb842cd1dc87850a from main.

comment:10 by Sarah Boyce, 3 months ago

Resolution: fixedwontfix

See comment.

Note: See TracTickets for help on using tickets.
Back to Top