[Django] #30986: Using conditional RawSQL's in QuerySet.filter() crashes on Oracle.

4 views
Skip to first unread message

Django

unread,
Nov 15, 2019, 4:13:19 AM11/15/19
to django-...@googlegroups.com
#30986: Using conditional RawSQL's in QuerySet.filter() crashes on Oracle.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: felixxm
Type: Bug | Status: assigned
Component: Database | Version: 3.0
layer (models, ORM) |
Severity: Release | Keywords: oracle
blocker |
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Using conditional `RawSQL`'s in `QuerySet.filter()` crashes on Oracle,
e.g.
{{{
Company.objects.filter(
RawSQL('num_employees > %s', (3,),
output_field=models.BooleanField()),
)
}}}
raises `django.db.utils.DatabaseError: ORA-00933: SQL command not properly
ended`.

This as a release blocker because using conditional expressions in
`QuerySet.filter()` is a new feature added in #25367.

Reported in [https://github.com/django/django/pull/12067 PR12067].

--
Ticket URL: <https://code.djangoproject.com/ticket/30986>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 15, 2019, 4:33:49 AM11/15/19
to django-...@googlegroups.com
#30986: Using conditional RawSQL's in QuerySet.filter() crashes on Oracle.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: felixxm
Type: Bug | Status: assigned
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: oracle rawsql | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* cc: Simon Charette, Carlton Gibson (added)
* keywords: oracle => oracle rawsql
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/12068 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/30986#comment:1>

Django

unread,
Nov 18, 2019, 3:17:52 AM11/18/19
to django-...@googlegroups.com
#30986: Using conditional RawSQL's in QuerySet.filter() crashes on Oracle.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: felixxm
Type: Bug | Status: closed

Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: oracle rawsql | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"8685e764efd2957085762d9249e07794d9a58dcb" 8685e764]:
{{{
#!CommitTicketReference repository=""
revision="8685e764efd2957085762d9249e07794d9a58dcb"
Fixed #30986 -- Fixed queryset crash when filtering against boolean RawSQL
expressions on Oracle.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30986#comment:2>

Django

unread,
Nov 18, 2019, 3:18:04 AM11/18/19
to django-...@googlegroups.com
#30986: Using conditional RawSQL's in QuerySet.filter() crashes on Oracle.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: felixxm
Type: Bug | Status: closed
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: oracle rawsql | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"b6be0699b9e2f39c1cbd20e36c58d6c3dc70a1f0" b6be069]:
{{{
#!CommitTicketReference repository=""
revision="b6be0699b9e2f39c1cbd20e36c58d6c3dc70a1f0"
[3.0.x] Fixed #30986 -- Fixed queryset crash when filtering against


boolean RawSQL expressions on Oracle.

Backport of 8685e764efd2957085762d9249e07794d9a58dcb from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30986#comment:3>

Reply all
Reply to author
Forward
0 new messages