﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36419	bulk_update() incorrectly updates JSONField None to JSON 'null' instead of SQL NULL	Clifford Gama	Clifford Gama	"Failing test:
{{{#!diff
diff --git a/tests/queries/test_bulk_update.py b/tests/queries/test_bulk_update.py
index 765fa934ca..2d24a74a60 100644
--- a/tests/queries/test_bulk_update.py
+++ b/tests/queries/test_bulk_update.py
@@ -300,6 +300,16 @@ class BulkUpdateTests(TestCase):
             JSONFieldNullable.objects.filter(json_field__has_key=""c""), objs
         )
 
+    @skipUnlessDBFeature(""supports_json_field"")
+    def test_json_field_none_value(self):
+        """"""Top level None value must be equivalent to SQL NULL in db.""""""
+        obj = JSONFieldNullable.objects.create(json_field={""k"": ""v""})
+        obj.json_field = None
+        JSONFieldNullable.objects.bulk_update([obj], fields=[""json_field""])
+        obj.refresh_from_db()
+        qs = JSONFieldNullable.objects.filter(json_field__isnull=True)
+        self.assertSequenceEqual(qs, [obj])
+
     def test_nullable_fk_after_related_save(self):
         parent = RelatedObject.objects.create()
         child = SingleObject()
}}}
This is inconsistent with `create()`, `update()` and `save()` (see [https://github.com/django/django/blob/b373721af0e5c3de0986977ac07e3ad55061ecbe/tests/model_fields/test_jsonfield.py#L227 test] and [https://docs.djangoproject.com/en/5.2/topics/db/queries/#storing-and-querying-for-none docs]), and can cause unexpected behaviour when a JSONField has `null=False`, since `JSON null` does not violate `null=False`.
"	Bug	closed	Database layer (models, ORM)	5.2	Release blocker	fixed		Simon Charette Sage Abdullah Adam Johnson	Ready for checkin	1	0	0	0	0	0
