Opened 14 years ago

Closed 14 years ago

Last modified 8 years ago

#14149 closed Bug (fixed)

LIKE clauses fail in Oracle 9.2.0.7

Reported by: Jirka Vejrazka Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2
Severity: Normal Keywords: oracle
Cc: Erin Kelly, Matt Boersma, Andrii Kurinnyi, tsawyer1 Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

I've recently started using Oracle backend, connecting to a database I don't own or operate. I started seeing behaviour described in #5985 (DatabaseError: ORA-01425: escape character must be character string of length 1), fixed in r7412. Since I was hitting an issue that's been apparently fixed, I started digging in history and found that the fix was reverted in r12293 (related ticket: #11017). The fact that it might reintroduce the bug is actually mentioned in the ticket.

I'm happy monkeypatching my Oracle base.py as I may as well be the only person suffering from this issue these days. Mentioning it here mostly for the record, if someone searches for it in future. I'm also happy to help testing any suggested solutions if someone has an idea that would fix #5985 without breaking #11017 again.

For the record, the database I'm connecting to is 9.2.0.7 (I know, old).

Attachments (1)

14149.diff (3.0 KB ) - added by Erin Kelly 14 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 by Thejaswi Puthraya, 14 years ago

Component: UncategorizedDatabase layer (models, ORM)

comment:2 by Erin Kelly, 14 years ago

Argh! I'm really starting to hate this issue. The underlying Oracle bug that was uncovered in #11017 is supposed to have been fixed in 9.2.0.6. I've tested it myself in 9.2.0.8 and am reasonably confident that the current implementation works there. I'm flummoxed as to what might be causing it in your scenario.

comment:3 by Erin Kelly, 14 years ago

Cc: Erin Kelly Matt Boersma added

comment:4 by Erin Kelly, 14 years ago

Summary: Oracle backend - conflict between two ticketsLIKE clauses fail in Oracle 9.2.0.7

comment:5 by Andrii Kurinnyi, 14 years ago

Cc: Andrii Kurinnyi added

comment:6 by tsawyer1, 14 years ago

We've just upgraded Oracle 10.2.0.4 to 10.2.0.5 and I've started encountering this bug.

I've patched my Django to use LIKEC instead of LIKE and it seems ok.

comment:7 by tsawyer1, 14 years ago

Cc: tsawyer1 added

comment:8 by tsawyer1, 14 years ago

We have support I can raise this with Oracle if required.

by Erin Kelly, 14 years ago

Attachment: 14149.diff added

comment:9 by Erin Kelly, 14 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

I've uploaded a patch against trunk that should fix this issue by choosing between LIKE and LIKEC at runtime, based on the discussion at http://groups.google.com/group/django-users/browse_thread/thread/360ad7db223af4da

Since I can't test this myself other than to verify that it doesn't break anything, I would appreciate it if those involved would test that this patch fixes the problem before I check it in.

comment:10 by Erin Kelly, 14 years ago

milestone: 1.3

comment:11 by Erin Kelly, 14 years ago

Resolution: fixed
Status: newclosed

(In [15299]) Fixed #14149: Initialize the Oracle connection.operators at connection time since some systems don't seem to like the "TRANSLATE" trick.

comment:12 by Erin Kelly, 14 years ago

(In [15300]) [1.2.X] Fixed #14149: Initialize the Oracle connection.operators at connection time since some systems don't seem to like the "TRANSLATE" trick.

Backport of r15299 from trunk.

comment:13 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

comment:14 by Tim Graham, 8 years ago

Description: modified (diff)
Easy pickings: unset
Severity: Normal
Type: Bug
UI/UX: unset
Note: See TracTickets for help on using tickets.
Back to Top