> The return type is Integer, with a return value of 1 for TRUE, 0 for
FALSE, and –1 for UNKNOWN corresponding to a function invocation on NULL
arguments.
Unfortunately, the `-1` value is not handled separately, so (e.g:)
`intersection` filters will include database records where the geometry is
NULL.
A fix would be to change the lookup from:
{{{
...
WHERE Intersects("modelname"."fieldname", GeomFromText('...',4326));
}}}
to
{{{
...
WHERE Intersects("modelname"."fieldname", GeomFromText('...',4326)) > 0;
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28380>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Fabian Schindler):
PR: https://github.com/django/django/pull/8722
--
Ticket URL: <https://code.djangoproject.com/ticket/28380#comment:1>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* needs_tests: 0 => 1
* stage: Unreviewed => Accepted
Comment:
The patch needs adjustments as some tests are failing and some additional
regression tests would be required for the handling of `None` arguments.
--
Ticket URL: <https://code.djangoproject.com/ticket/28380#comment:2>
Comment (by Fabian Schindler):
New [https://github.com/django/django/pull/8725 PR] (old one was closed
because of wrong base)
--
Ticket URL: <https://code.djangoproject.com/ticket/28380#comment:3>
* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/28380#comment:4>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28380#comment:5>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"da0fb5b1ec89a747459ab64482f3202cb452c068" da0fb5b1]:
{{{
#!CommitTicketReference repository=""
revision="da0fb5b1ec89a747459ab64482f3202cb452c068"
Fixed #28380 -- Excluded null geometries in SpatiaLite geometry lookups.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28380#comment:6>