<feed xmlns='http://www.w3.org/2005/Atom'>
<title>django.git/django/db/models/sql/compiler.py, branch stable/6.0.x</title>
<subtitle>django
</subtitle>
<id>http://cgit.adnoto.dev/django.git/atom?h=stable%2F6.0.x</id>
<link rel='self' href='http://cgit.adnoto.dev/django.git/atom?h=stable%2F6.0.x'/>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/'/>
<updated>2026-02-03T13:04:49Z</updated>
<entry>
<title>[6.0.x] Fixed CVE-2026-1312 -- Protected order_by() from SQL injection via aliases with periods.</title>
<updated>2026-02-03T13:04:49Z</updated>
<author>
<name>Jacob Walls</name>
<email>jacobtylerwalls@gmail.com</email>
</author>
<published>2026-01-21T22:53:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=15e70cb83e6f7a9a2a2f651f30b28b5cb20febeb'/>
<id>urn:sha1:15e70cb83e6f7a9a2a2f651f30b28b5cb20febeb</id>
<content type='text'>
Before, `order_by()` treated a period in a field name as a sign that it
was requested via `.extra(order_by=...)` and thus should be passed
through as raw table and column names, even if `extra()` was not used.
Since periods are permitted in aliases, this meant user-controlled
aliases could force the `order_by()` clause to resolve to a raw table
and column pair instead of the actual target field for the alias.

In practice, only `FilteredRelation` was affected, as the other
expressions we tested, e.g. `F`, aggressively optimize away the ordering
expressions into ordinal positions, e.g. ORDER BY 2, instead of ORDER BY
"table".column.

Thanks Solomon Kebede for the report, and Simon Charette and Jake Howard
for reviews.

Backport of 69065ca869b0970dff8fdd8fafb390bf8b3bf222 from main.
</content>
</entry>
<entry>
<title>Refs #27222 -- Refreshed GeneratedFields values on save() initiated update.</title>
<updated>2025-09-13T22:27:49Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2025-03-19T05:11:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=55a0073b3beb9de8f7c1f7c44a7d0bc10126c841'/>
<id>urn:sha1:55a0073b3beb9de8f7c1f7c44a7d0bc10126c841</id>
<content type='text'>
This required implementing UPDATE RETURNING machinery that heavily
borrows from the INSERT one.
</content>
</entry>
<entry>
<title>Refs #27222 -- Adapted RETURNING handling to be usable for UPDATE queries.</title>
<updated>2025-08-28T18:44:21Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2025-03-22T01:50:54Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=292b9e6fe8f23491680d9cc60f328562e2b1c823'/>
<id>urn:sha1:292b9e6fe8f23491680d9cc60f328562e2b1c823</id>
<content type='text'>
Renamed existing methods and abstractions used for INSERT … RETURNING
to be generic enough to be used in the context of UPDATEs as well.

This also consolidates SQL compliant implementations on
BaseDatabaseOperations.
</content>
</entry>
<entry>
<title>Refs #36500 -- Rewrapped long docstrings and block comments via a script.</title>
<updated>2025-07-23T23:17:55Z</updated>
<author>
<name>django-bot</name>
<email>ops@djangoproject.com</email>
</author>
<published>2025-07-23T03:41:41Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=69a93a88edb56ba47f624dac7a21aacc47ea474f'/>
<id>urn:sha1:69a93a88edb56ba47f624dac7a21aacc47ea474f</id>
<content type='text'>
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
</content>
</entry>
<entry>
<title>Fixed #36301 -- Fixed select_for_update(of) crash when using values()/values_list().</title>
<updated>2025-04-07T20:56:40Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2025-04-04T18:42:31Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=71a19a0e475165dbc14c1fe02f552013ee670e4c'/>
<id>urn:sha1:71a19a0e475165dbc14c1fe02f552013ee670e4c</id>
<content type='text'>
Regression in 65ad4ade74dc9208b9d686a451cd6045df0c9c3a which allowed for
annotations to be SELECT'ed before model field references through
values()/values_list() and broke assumptions the select_for_update(of)
table infererence logic had about model fields always being first.

Refs #28900.

Thanks OutOfFocus4 for the report and Sarah for the test.
</content>
</entry>
<entry>
<title>Refs #28909 -- Simplified code using unpacking generalizations.</title>
<updated>2025-04-01T01:43:13Z</updated>
<author>
<name>Aarni Koskela</name>
<email>akx@iki.fi</email>
</author>
<published>2025-03-05T16:45:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=c972af69e2021b75b89d8bc47e214ef875bbdc06'/>
<id>urn:sha1:c972af69e2021b75b89d8bc47e214ef875bbdc06</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Refs #36181 -- Removed the obsolete SubqueryConstraint machinery.</title>
<updated>2025-02-13T08:29:24Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2025-02-10T02:43:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=d386405e04dac50656af50d100a14efdf8c58e8f'/>
<id>urn:sha1:d386405e04dac50656af50d100a14efdf8c58e8f</id>
<content type='text'>
Adding proper support for subquery right-hand-sides to TupleIn made it
obsolete.
</content>
</entry>
<entry>
<title>Fixed #36088 -- Avoided unnecessary DEFAULT usage on bulk_create().</title>
<updated>2025-02-01T17:43:10Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2024-12-09T23:38:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=4608d34b346c28d5d227363c881d3279378f40b3'/>
<id>urn:sha1:4608d34b346c28d5d227363c881d3279378f40b3</id>
<content type='text'>
When all values of a field with a db_default are DatabaseDefault, which
is the case most of the time, there is no point in specifying explicit
DEFAULT for all INSERT VALUES as that's what the database will do anyway
if not specified.

In the case of PostgreSQL doing so can even be harmful as it prevents
the usage of the UNNEST strategy and in the case of Oracle, which
doesn't support the usage of the DEFAULT keyword, it unnecessarily
requires providing literal db defaults.

Thanks Lily Foote for the review.
</content>
</entry>
<entry>
<title>Fixed #36122 -- Raised FieldError when updating with composite reference value.</title>
<updated>2025-01-28T12:05:53Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2025-01-26T00:13:13Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=efec74b90868c2e611f863bf4301d92ce08067e8'/>
<id>urn:sha1:efec74b90868c2e611f863bf4301d92ce08067e8</id>
<content type='text'>
Thanks Jacob Walls for the report and test.
</content>
</entry>
<entry>
<title>Fixed #36086 -- Fixed crash when using GeneratedField with non-AutoField pk.</title>
<updated>2025-01-13T10:13:29Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2025-01-11T06:08:35Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=9e552015556661d183a999078a9e846200ef6765'/>
<id>urn:sha1:9e552015556661d183a999078a9e846200ef6765</id>
<content type='text'>
The previous logic was systematically attempting to retrieve last_insert_id
even for models without an AutoField primary key when they had a GeneratedField
on backends that can't return columns from INSERT.

The issue affected MySQL, SQLite &lt; 3.35, and Oracle when the use_returning_into
option was disabled and could result in either crashes when the non-auto
primary key wasn't an IntegerField subclass or silent misassignment of bogus
insert ids (0 or the previous auto primary key insert value) to the first
defined generated field value.
</content>
</entry>
</feed>
