﻿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
32888	Document that select_for_update() doesn't lock tables when their columns are not selected.	Hannes Ljungberg	Hannes Ljungberg	"The existing test ""test_for_update_of_self_when_self_is_not_selected"" can be extended to demonstrate this behaviour:

{{{
diff --git a/tests/select_for_update/tests.py b/tests/select_for_update/tests.py
index 705975b760..00fa102d33 100644
--- a/tests/select_for_update/tests.py
+++ b/tests/select_for_update/tests.py
@@ -240,9 +240,15 @@ class SelectForUpdateTests(TransactionTestCase):
         select_for_update(of=['self']) when the only columns selected are from
         related tables.
         """"""
-        with transaction.atomic():
+        with transaction.atomic(), CaptureQueriesContext(connection) as ctx:
             values = list(Person.objects.select_related('born').select_for_update(of=('self',)).values('born__name'))
         self.assertEqual(values, [{'born__name': self.city1.name}])
+        if connection.features.select_for_update_of_column:
+            expected = ['select_for_update_person"".""id']
+        else:
+            expected = ['select_for_update_person']
+        expected = [connection.ops.quote_name(value) for value in expected]
+        self.assertTrue(self.has_for_update_sql(ctx.captured_queries, of=expected))

     @skipUnlessDBFeature('has_select_for_update_nowait')
     def test_nowait_raises_error_on_block(self):
}}}"	Cleanup/optimization	closed	Documentation	dev	Normal	fixed			Accepted	1	0	0	0	0	0
