Opened 5 years ago

Closed 5 years ago

#30859 closed Cleanup/optimization (fixed)

Enable the supports_aggregate_filter_clause database feature on SQLite >= 3.30.1

Reported by: Simon Charette Owned by: Mariusz Felisiak
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

From https://www.sqlite.org/changes.html#version_3_30_0

Add support for the FILTER clause on aggregate functions.

Even if CI is not on SQLite 3.30 it can be tested locally on Linux using LD_PRELOAD https://github.com/orf/django-docker-box/issues/25

Change History (8)

comment:1 by Simon Charette, 5 years ago

The suite segfaults on the following tests

  • aggregation.test_filter_argument.FilteredAggregateTests.test_filtered_aggregate_ref_annotation
  • aggregation.test_filter_argument.FilteredAggregateTests.test_filtered_aggregate_ref_subquery_annotation

It seems to be related to references from subqueries as both tests perform a subquery pushdown. I've filled a SQLite bug report about it.

comment:2 by Carlton Gibson, 5 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Mariusz Felisiak, 5 years ago

SQLite fixed this issue in 3.30.1.

comment:5 by Simon Charette, 5 years ago

Yep, I was planing on submitting a patch later today but feel free to do so if you'd like.

comment:6 by Mariusz Felisiak, 5 years ago

I don't want to change your plans :)

comment:7 by Mariusz Felisiak, 5 years ago

Has patch: set
Owner: changed from nobody to Mariusz Felisiak
Status: newassigned
Summary: Enable the supports_aggregate_filter_clause database feature on SQLite >= 3.30Enable the supports_aggregate_filter_clause database feature on SQLite >= 3.30.1

comment:8 by GitHub <noreply@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 4a849b6:

Fixed #30859 -- Fixed DatabaseFeatures.supports_aggregate_filter_clause on SQLite 3.30.1+.

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