#35842: JSONField has_key, has_keys, has_any_keys lookups do not properly handle
quotes on Oracle and SQLite
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Sage
| Abdullah
Type: Bug | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: oracle sqlite json | Triage Stage: Accepted
key quote |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sage Abdullah):
Apparently it's fixed in SQLite 3.37.0 (released 2024-10-21)!
It's not in the [https://www.sqlite.org/changes.html release notes], but
you can see
[https://www3.sqlite.org/src/fdiff?v1=5b6a1d6015997b9e&v2=68a98c020c22127f
the changeset]. Looks like it was
[https://www3.sqlite.org/src/fdiff?v1=bf1b51e32158b3d0&v2=e60c9f5132c974ef
backported to the 3.36 branch too], but given that 3.37.0 and even 3.37.1
have been released, it looks like there won't be any more 3.36.x releases
(at least based on the [https://www.sqlite.org/chronology.html chronology
of past releases]).
I can confirm this by downloading a precompiled SQLite from
[https://www.sqlite.org/download.html the download page] and running the
following query:
{{{
select json_extract(json('{"foo\".bar": "ba\"z", "x": "y"}'),
'$."foo\".bar"');
}}}
I have yet to run the Django test, as updating the SQLite version is a bit
more complicated – I'll do that this weekend. Anyhow, if it works, I think
we should remove the expected test failure if the SQLite version is >=
3.37.0.
Not sure how to update it in CI, though. It's tricky because you need to
compile Python with the newer SQLite installed on the system so that the
resulting `libsqlite3.so.0` inside Python's `lib` directory is compiled
with the newer SQLite. Or, you can compile it separately and then replace
the lib file in the Python installation (or use the `LD_LIBRARY_PATH`
environment variable). Alternatively, we can just wait until the Python
that's distributed in the docker (?) image used in our Jenkins setup gets
updated.
--
Ticket URL: <https://code.djangoproject.com/ticket/35842#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/010701938ccfff63-4f68ba2b-f98f-46e7-a21f-33fd93e6e150-000000%40eu-central-1.amazonses.com.