#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 Simon Charette):

 > Apparently it's fixed in SQLite 3.37.0 (released 2024-10-21)!

 The `test_has_key_special_chars` test attached to this ticket still fails
 against against SQLite 3.37.0 and on 3.46.0 on macOS (x86) and on Linux.
 [https://github.com/orf/django-docker-box/issues/25#issuecomment-459990118
 I built it from source] on both platform and used `set env
 DYLD_INSERT_LIBRARIES` on macOS and `LD_PRELOAD` on Linux.

 > I can confirm this by downloading a precompiled SQLite from ​the
 download page and running the following query:

 I get different results on my side

 {{{
 SQLite version 3.37.0 2021-12-09 01:34:53
 Enter ".help" for usage hints.
 Connected to a transient in-memory database.
 Use ".open FILENAME" to reopen on a persistent database.
 sqlite> select json_extract(json('{"foo\".bar": "ba\"z", "x": "y"}'),
 '$."foo\".bar"');

 sqlite> select json_extract(json('{"foo\".bar": "ba\"z", "x": "y"}'),
 '$."x"');
 y
 }}}

 To make sure that the built library is used you access
 `sqlite3.sqlite_version` in the Python terminal from the environment you
 used to run your tests

 {{{
 >>> import sqlite3
 >>> sqlite3.sqlite_version
 '3.46.0'
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35842#comment:12>
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/010701939513cf3c-b04e5495-8968-49c6-be58-c0851ad009d9-000000%40eu-central-1.amazonses.com.

Reply via email to