Skip to content

Fix nested left join null detection#5785

Open
lukitadproxd-netizen wants to merge 1 commit into
drizzle-team:mainfrom
lukitadproxd-netizen:codex/fix-nested-left-join-null-detection
Open

Fix nested left join null detection#5785
lukitadproxd-netizen wants to merge 1 commit into
drizzle-team:mainfrom
lukitadproxd-netizen:codex/fix-nested-left-join-null-detection

Conversation

@lukitadproxd-netizen
Copy link
Copy Markdown

@lukitadproxd-netizen lukitadproxd-netizen commented May 20, 2026

Closes #1603

Summary

  • Fixes nested select result mapping for left joins when the first selected column from a joined table is null but later columns from the same table are not null.
  • Keeps nullable joined objects only when at least one selected column from that table has a non-null value.
  • Adds regression coverage for both the partial-null and all-null joined object cases.

Test plan

  • corepack pnpm install --frozen-lockfile --ignore-scripts
  • corepack pnpm --dir drizzle-orm exec vitest run tests/utils.test.ts
  • corepack pnpm exec dprint check drizzle-orm/src/utils.ts drizzle-orm/tests/utils.test.ts

Note: local full install with lifecycle scripts is blocked on this Windows/Node 24 environment by native optional dependency builds (better-sqlite3/cpu-features). The focused test above is pure and passes locally.

/claim #1603

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