| Age | Commit message (Collapse) | Author |
|
(23.7+).
Thanks Jacob Walls for the review.
|
|
This required implementing UPDATE RETURNING machinery that heavily
borrows from the INSERT one.
|
|
Previously save() would crash with an attempted forced update message, and both
save(force_insert=True) and bulk_create() would crash with DoesNotExist errors
trying to retrieve rows with an empty primary key (id IS NULL).
Implementing deferred field model instance copying might be doable in certain
cases (e.g. when all the deferred fields are db generated) but that's not
trivial to implement in a backward compatible way.
Thanks Adam Sołtysik for the report and test and Clifford for the review.
|
|
|
|
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 < 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.
|
|
Accessing generated field values on unsaved models caused a crash when
validating CheckConstraints and UniqueConstraints with expressions.
|
|
Thanks Matt Hegarty for the report and Simon Charette and Natalia Bidart for the reviews.
Regression in f333e35.
|
|
GeneratedFields in aliased tables.
Thanks Simon Charette for the review.
|
|
Thanks Claude Paroz for the report.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
|
|
ForeignKeys.
Thanks Deb Kumar Das for the report.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
|
|
GeneratedField.output_field with backend converters.
Regression in d9de74141e8a920940f1b91ed0a3ccb835b55729.
This is a long standing issue, however it caused a crash of
GeneratedFields for all output fields that have backend-specific
converters when the RETURNING clause is not supported
(MySQL and SQLite < 3.35).
That's why severity was exacerbated.
|
|
are not populated.
Thanks Paolo Melchiorre for the report.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
|
|
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
|
|
CockroachDB and Snowflake don't support it.
|
|
output_field with params.
|
|
Test regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
|
|
|
|
Thanks Simon Charette for the implementation idea.
|
|
Thanks Adam Johnson and Paolo Melchiorre for reviews.
Co-Authored-By: Lily Foote <code@lilyf.org>
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|