Skip to content

fix(sql): use comparison coercion for IN lists - #2512

Open
Th0masclassic wants to merge 2 commits into
getdozer:mainfrom
Th0masclassic:fix/in-list-comparison-coercion
Open

Th0masclassic wants to merge 2 commits into
getdozer:mainfrom
Th0masclassic:fix/in-list-comparison-coercion

Conversation

@Th0masclassic

@Th0masclassic Th0masclassic commented Sep 8, 2026

Copy link
Copy Markdown

/claim #1659

Summary

Fix a remaining static IN (...) semantic gap from #1659: compatible values that Dozer's normal equality operator coerces were compared as raw Field variants inside IN lists.

For example, current main evaluates 42 = 42.0 as true using SQL comparison coercion, while 42 IN (42.0) evaluates to false.

This patch reuses the existing equality evaluator for non-null list comparisons so IN and NOT IN are consistent with Dozer's normal equality semantics.

This is intentionally scoped separately from the NULL-semantics work in #2494 and from the IN (SELECT ...) implementations. Existing NULL behavior is preserved.

Changes

  • Reuse evaluate_eq for compatible non-null IN list items.
  • Add regression coverage for 42 IN (42.0).
  • Add regression coverage for 42 NOT IN (42.0).
  • Preserve existing NULL behavior.

Demo

Short demo video: https://github.com/Th0masclassic/dozer/releases/download/dozer-1659-in-coercion-demo/demo.mp4

The demo shows the upstream semantic mismatch, the patched behavior, and the validation results.

Validation

  • Regression test confirmed to fail against the upstream implementation.
  • Regression test passes with this patch in GitHub Actions and locally.
  • Existing IN expression tests pass locally: 3 passed, 0 failed.
  • rustfmt --check passes for the modified Rust files.
  • git diff --check passes.
  • CI: https://github.com/Th0masclassic/dozer/actions/runs/34276426474

AI-assisted development disclosure: ChatGPT was used to assist with investigation and implementation; the resulting changes and regression coverage were reviewed and validated before submission.

@CLAassistant

CLAassistant commented Sep 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Th0masclassic
Th0masclassic marked this pull request as ready for review September 8, 2026 21:21
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.

2 participants