Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Matching of Null Values in JSONField Lookups on SQLite and Oracle #125

Open
archie-ai-code-explain-pr-review bot opened this issue Jul 13, 2024 · 0 comments

Comments

@archie-ai-code-explain-pr-review
  • 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants