[stable34] fix(preview): qualify the ambiguous columns in PreviewMapper queries - #63347
Conversation
joinLocation() joins previews (p) with preview_locations (l) and preview_versions (v). Both previews and preview_versions have a file_id column, so any unqualified file_id condition is ambiguous and MySQL or MariaDB reject the query with error 1052. getPreviewForSpecification() built its conditions straight from the caller's array keys, so this broke every preview save: savePreview() uses that lookup to recover the existing row after a unique constraint violation. getByFileId() had the same unqualified condition, while getAvailablePreviewsForFile() next to it already used p.file_id. Columns that come from the joined tables keep resolving to their own alias, and keys that already carry one are passed through untouched. The values are bound with an explicit type as well. An untyped false binds as an empty string, which PostgreSQL rejects for a boolean column, so qualifying the columns on their own only moved the error on that backend. Fixes: #63229 Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
cc6cc7e to
2de74e3
Compare
|
Confirming this backport is needed on stable34. Hit both issues on a fresh 34.0.3 / PostgreSQL 16 instance while running The run aborts on the first affected file. Two distinct failures, both in
Both are covered by this PR (the Worth noting for prioritisation: this makes Sobald dein Lauf mit dem vollständigen Upstream-Patch durchläuft, kannst du einen Satz anhängen: ▎ Applying this patch on top of 34.0.3 resolves both errors; preview:generate-all now completes over the full library. |
Backport of PR #63286