[Django] #30120: Query syntax error with condition and distinct combination

瀏覽次數:5 次
跳到第一則未讀訊息

Django

未讀,
2019年1月20日 下午2:34:562019/1/20
收件者:django-...@googlegroups.com
#30120: Query syntax error with condition and distinct combination
-------------------------------------+-------------------------------------
Reporter: Claude | Owner: nobody
Paroz |
Type: Bug | Status: new
Component: Database | Version: 2.2
layer (models, ORM) |
Severity: Release | Keywords:
blocker |
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
A `Count` annotation containing both a `Case` condition and a
`distinct=True` param produces a query error on Django 2.2 (whatever the
db backend). A space is missing at least (`... COUNT(DISTINCTCASE WHEN
...`).

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

Django

未讀,
2019年1月20日 下午2:35:422019/1/20
收件者:django-...@googlegroups.com
#30120: Query syntax error with condition and distinct combination
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

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

* Attachment "query_test.diff" added.

Failing test example

Django

未讀,
2019年1月20日 下午2:45:362019/1/20
收件者:django-...@googlegroups.com
#30120: Query syntax error with condition and distinct combination
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

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

Comment (by Claude Paroz):

Bisected to [bc05547cd8c1dd511c6b6a6c873a1bc63417b111] Fixed #28658 --
Added DISTINCT handling to the Aggregate class.

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

Django

未讀,
2019年1月20日 下午5:58:242019/1/20
收件者:django-...@googlegroups.com
#30120: Query syntax error with condition and distinct combination
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Simon
| Charette
Type: Bug | Status: assigned

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

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

* owner: nobody => Simon Charette
* status: new => assigned
* stage: Unreviewed => Accepted


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

Django

未讀,
2019年1月20日 晚上7:22:472019/1/20
收件者:django-...@googlegroups.com
#30120: Query syntax error with condition and distinct combination
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Simon
| Charette
Type: Bug | Status: assigned
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


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

Django

未讀,
2019年1月21日 凌晨3:46:202019/1/21
收件者:django-...@googlegroups.com
#30120: Query syntax error with condition and distinct combination
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Simon
| Charette
Type: Bug | Status: assigned
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

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

* stage: Accepted => Ready for checkin


Comment:

Thanks for the quick fix!

--
Ticket URL: <https://code.djangoproject.com/ticket/30120#comment:4>

Django

未讀,
2019年1月21日 上午9:25:292019/1/21
收件者:django-...@googlegroups.com
#30120: Query syntax error with condition and distinct combination
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Simon
| Charette
Type: Bug | Status: closed

Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"6516e49262546238d02f6ca37b74ee0e67dead0a" 6516e492]:
{{{
#!CommitTicketReference repository=""
revision="6516e49262546238d02f6ca37b74ee0e67dead0a"
[2.2.x] Fixed #30120 -- Fixed invalid SQL in distinct aggregate.

Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111 (refs #28658).
Backport of 65858119d23e37872505a4476e7141c33981fb50 from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30120#comment:5>

Django

未讀,
2019年1月21日 上午9:25:312019/1/21
收件者:django-...@googlegroups.com
#30120: Query syntax error with condition and distinct combination
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Simon
| Charette
Type: Bug | Status: closed
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

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

Comment (by Tim Graham <timograham@…>):

In [changeset:"65858119d23e37872505a4476e7141c33981fb50" 65858119]:
{{{
#!CommitTicketReference repository=""
revision="65858119d23e37872505a4476e7141c33981fb50"


Fixed #30120 -- Fixed invalid SQL in distinct aggregate.

Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111 (refs #28658).
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30120#comment:6>

回覆所有人
回覆作者
轉寄
0 則新訊息