#36445: Value(None, output_field=JSONField()) incorrectly saves as SQL NULL in bulk_update() -------------------------------------+------------------------------------- Reporter: Clifford Gama | Owner: Uddyan | Goyal Type: Bug | Status: assigned Component: Database layer | Version: dev (models, ORM) | Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Comment (by Thomas):
I've made a regression test for the use case detailed in #36453. [https://github.com/thomas- mckay/django/commit/5ca2b19568b39c41248479ad4b19973fe622c438] After bisection, I've noticed that the test passes from `4.2` to `5.2.2`. It breaks in `5.2.3` and before `4.2`. To recap: - https://github.com/django/django/commit/d87a7b9f4b4c75fc03ce6bbf55c880a79d524306 was introduced in `4.2`. Before this commit the test fails, after this commit the test passes, until `5.2.3` - https://github.com/django/django/commit/6fc620b4a8e91839b93af2b52d80bdbd5f8a1fcc was introduced in `5.2.3`. After this commit the test fails again. I've checked `Value.for_save`, and it is indeed `False` in `5.2.2` and `True` in `5.2.3` for the `Value` in the `When` condition. So, I understand why #36453 may have been closed as a duplicate of this one: the same change is responsible. My only concern is that the bug in this ticket only covers one of the symptoms of that change (that may or may not be a regression), but not the one I'm experiencing (which I really hope is considered a regression), and that addressing this symptom will not fix the behavior that's been broken in my case. Let me know if I'm taking this ticket off-topic and I'll re-open my ticket and continue there. -- Ticket URL: <https://code.djangoproject.com/ticket/36445#comment:8> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/django-updates/010701975ebbca09-9ec5501a-caf5-4ed1-b45a-e2252e72c1ca-000000%40eu-central-1.amazonses.com.