[Django] #36147: django oracle backend wildcard issue

7 views
Skip to first unread message

Django

unread,
Jan 27, 2025, 1:06:11 PM1/27/25
to django-...@googlegroups.com
#36147: django oracle backend wildcard issue
-------------------------------------+-------------------------------------
Reporter: Terence Collins | Type:
| Uncategorized
Status: new | Component: Database
| layer (models, ORM)
Version: 5.1 | Severity: Normal
Keywords: oracle, db, | Triage Stage:
backend, % | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
in django/db/backends/oracle/base.py, in _fix_for_params, line 542:
query %= args

will cause an error if the passed in string using an SQL wildcard, i.e.
"custom_value like '%custom_value%'.
This can be avoided by escaping the "%" as "%%", but as this is an
underlying function the resultant error can be hard to track down.
--
Ticket URL: <https://code.djangoproject.com/ticket/36147>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 27, 2025, 4:55:27 PM1/27/25
to django-...@googlegroups.com
#36147: django oracle backend wildcard issue
-------------------------------------+-------------------------------------
Reporter: Terence Collins | Owner: (none)
Type: Uncategorized | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: oracle, db, | Triage Stage:
backend, % | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Tim Graham):

Can you give a concrete example of how to reproduce the problem? It sounds
like you're writing raw SQL and not escaping it correctly. You recognize
that this is your fault but ask if Django could raise a more helpful
message. (Please tell me if I misinterpreted.)
--
Ticket URL: <https://code.djangoproject.com/ticket/36147#comment:1>

Django

unread,
Jan 28, 2025, 3:53:48 AM1/28/25
to django-...@googlegroups.com
#36147: django oracle backend wildcard issue
-------------------------------------+-------------------------------------
Reporter: Terence Collins | Owner: (none)
Type: Uncategorized | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: oracle, db, | Triage Stage:
backend, % | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* resolution: => needsinfo
* status: new => closed

Comment:

(We can reopen when we have more details to replicate)
--
Ticket URL: <https://code.djangoproject.com/ticket/36147#comment:2>
Reply all
Reply to author
Forward
0 new messages