Opened 6 years ago

Closed 6 years ago

#15534 closed Bug (fixed)

Oracle backend regex lookup broken if Oracle backend is not default

Reported by: JirkaV Owned by: nobody
Component: Database layer (models, ORM) Version: 1.3-beta
Severity: Normal Keywords: oracle, multi-db
Cc: JirkaV Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I hit a bug with django-pyodbc that was related to multi-db and realized that Oracle backend has the same problem. The problem lies [browser:django/trunk/django/db/backends/oracle/base.py?rev=15299#L260 here]. This will break if the Oracle backend is not the default one.

I have not figured out a good way to get the right connection in this portion of code. I did monkeypatch my copy of code (the django-pyodbc one) in the following way, but have no idea what a good solution might be.

Change History (7)

comment:1 Changed 6 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by Ian Kelly

This point was also raised in #9405, which was closed wontfix at the time. This is something that we do need to fix one way or another, though.

comment:3 Changed 6 years ago by JirkaV

Cc: JirkaV added

comment:4 Changed 6 years ago by Ramiro Morales

The technique of passing the connection to the DatabaseOperations instance is already being used in the PostgreSQL backends (most surely a change introduced after Malcolm added his comment to #9405 opposing to such an API change). The inconsistency of these two backends with django.db.backends.BaseDatabaseOperations and the rest of the DB backends we ship is reported in #13630. Once we fix it we'll hopefully be able t use that instance variable to solve this issue.

Last edited 6 years ago by Ramiro Morales (previous) (diff)

comment:5 Changed 6 years ago by Luke Plant

Type: Bug

comment:6 in reply to:  4 Changed 6 years ago by Ramiro Morales

Severity: Normal

Replying to ramiro:

The technique of passing the connection to the DatabaseOperations instance is already being used in the PostgreSQL backends (most surely a change introduced after Malcolm added his comment to #9405 opposing to such an API change).

The change was introduced when the multi-db branch got merged in with trunk, in revision 11952.

comment:7 Changed 6 years ago by Ian Kelly

Resolution: fixed
Status: newclosed

In [16041]:

Fixed #15534: Made the Oracle runtime test for regex capabilities use the DatabaseOperations connection instead of grabbing the default connection.

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