fix(preview): qualify the ambiguous columns in PreviewMapper queries - #63286
Open
solracsf wants to merge 1 commit into
Open
fix(preview): qualify the ambiguous columns in PreviewMapper queries#63286solracsf wants to merge 1 commit into
solracsf wants to merge 1 commit into
Conversation
solracsf
requested review from
CarlSchwan,
icewind1991,
provokateurin and
salmart-dev
and removed request for
a team
August 15, 2026 06:16
Member
Author
|
/backport to stable34 |
Member
Author
|
/backport to stable33 |
Member
Author
|
Patch for 32bits failure: #63291 |
8 tasks
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>
solracsf
force-pushed
the
fix/preview-mapper-query-correctness
branch
from
August 15, 2026 17:37
1a7f397 to
54bbb32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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, whilegetAvailablePreviewsForFile()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, so a caller can still filter on
v.version.The values are bound with an explicit type as well. An untyped
falsebinds 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:savePreview()passescroppedas a PHP bool andfalseis the common case.Fixes: #63229
Checklist
3. to review, feature component)stable32)AI (if applicable)