Skip to content

fix(orm): preserve nested partial-select on left join when first field is null - #6178

Open
YtinuMoc wants to merge 2 commits into
drizzle-team:mainfrom
YtinuMoc:fix/nested-partial-select-null-1603
Open

fix(orm): preserve nested partial-select on left join when first field is null#6178
YtinuMoc wants to merge 2 commits into
drizzle-team:mainfrom
YtinuMoc:fix/nested-partial-select-null-1603

Conversation

@YtinuMoc

Copy link
Copy Markdown

Closes #1603.

Summary

  • fix nullifyMap in mapResultRow so nested partial-select objects are not nullified when only the first joined column is null
  • add utils.test.ts regression for mixed null/non-null joined fields and all-null joined fields

Validation

  • pnpm exec vitest run drizzle-orm/tests/utils.test.ts (2 tests)

/claim #1603

@algora-pbc /claim #1603

Marcus McGrath and others added 2 commits August 26, 2026 18:58
…d is null

Closes drizzle-team#1603.

When the first column from a nullable left join is null but a later column
from the same table is non-null, mapResultRow should keep the nested object
instead of nullifying the whole object.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ial-select

Regression test mirrors the reported logo-null / panelBackground-non-null
left-join case from drizzle-orm#1603.

Co-authored-by: Cursor <cursoragent@cursor.com>
@YtinuMoc

Copy link
Copy Markdown
Author

Verified `vitest run tests/utils.test.ts` on head `90277d36`: 3/3 pass (2026-08-26T11:40Z, pnpm/vitest 3.1.4). Mergeable, `behind_by=0`. /attempt + /claim #1603 posted; Algora $50 `clrpajuvw0004l40fv9obk8t8`. Ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Nested Partial Select returns null on left join if first column value is null

1 participant