You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The KeyTransformIsNull lookup on SQLite and Oracle incorrectly matches objects that have the key with the value null, when the query should only match objects that do not have the key.
The expected behavior is that the query NullableJSONModel.objects.filter(value__j__isnull=True) should return the objects with indices [0, 1, 2, 3, 5, 6, 7], but on SQLite and Oracle, it also includes the object with index 4, which has the key j with a null value.
This issue is present in the Django test tests.model_fields.test_jsonfield.TestQuerying.test_isnull_key, and the test can be updated to catch this behavior by changing the first assertion to check the value__j__isnull=True query instead of value__a__isnull=True.
The text was updated successfully, but these errors were encountered:
KeyTransformIsNull
lookup on SQLite and Oracle incorrectly matches objects that have the key with the valuenull
, when the query should only match objects that do not have the key.NullableJSONModel.objects.filter(value__j__isnull=True)
should return the objects with indices[0, 1, 2, 3, 5, 6, 7]
, but on SQLite and Oracle, it also includes the object with index 4, which has the keyj
with anull
value.tests.model_fields.test_jsonfield.TestQuerying.test_isnull_key
, and the test can be updated to catch this behavior by changing the first assertion to check thevalue__j__isnull=True
query instead ofvalue__a__isnull=True
.The text was updated successfully, but these errors were encountered: