]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Gracefully degrade for SQLite JSON receiving direct numeric value
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 29 Nov 2019 15:50:44 +0000 (10:50 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 29 Nov 2019 15:54:42 +0000 (10:54 -0500)
commit56c4204af33066507ea2a7856b24d802a71cd31a
treea9fc400d0e4287835297eeaf79c92e25918d6342
parent80ecc638697c9c4f31c613acc3c2d956ee0de159
Gracefully degrade for SQLite JSON receiving direct numeric value

Fixed issue to workaround SQLite's behavior of assigning "numeric" affinity
to JSON datatypes, first described at :ref:`change_3850`, which returns
scalar numeric JSON values as a number and not as a string that can be JSON
deserialized.  The SQLite-specific JSON deserializer now gracefully
degrades for this case as an exception and bypasses deserialization for
single numeric values, as from a JSON perspective they are already
deserialized.

Also adds a combinatoric fixture for JSON single values within
the dialect-general test suite.

Fixes: #5014
Change-Id: Id38221dce1271fec527ca198b23908547b25d8a0
(cherry picked from commit bb338b91752f4f758edd9b2549a228e891596ae0)
doc/build/changelog/unreleased_13/5014.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/testing/suite/test_types.py