Skip to content

fix: Predicate.And takes for a conjunct only what it wrote itself - #88

Merged
CaffeinatedCoder merged 1 commit into
mainfrom
fix/predicate-and
Nov 12, 2026
Merged

CaffeinatedCoder merged 1 commit into
mainfrom
fix/predicate-and

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #83

Problem

Predicate.And left a predicate as it was when its text ended in AND (other): 5.x's rule for a convention that runs twice. A hand-written {A} OR {B} AND ({C}) ends the same way and is A OR (B AND C). Adding {C} to it changed nothing, so the condition stayed wider than the one asked for and a constraint or a unique index covered rows it was told to leave out. Nothing failed. The translator parenthesises every OR, so only a predicate written by hand reached it.

Change

And takes for a conjunct only what it writes itself: (…) AND (other), where the first parenthesis closes right before the AND. Parentheses inside a quoted literal are not counted.

One answer changes against 5.x: a hand-written {A} IS NULL AND ({C}), which is a conjunction, now gets {C} added once more. Redundant, and correct.

Tests

457 kernel and 64 PostgreSQL tests without a server. Six rows: three shapes that end like a conjunct and are none, and three with a parenthesis inside a literal, in both directions. What And wrote is still recognised three deep.

Each guard shown to fail, in a scratch copy:

Mutation Fails
Any ending counts, as in 5.x 4 rows
Literals not skipped the 2 rows with a parenthesis in a literal that is a conjunction
Any text that starts and ends with a parenthesis is one group 2 rows

🤖 Generated with Claude Code

@CaffeinatedCoder CaffeinatedCoder added this to the 11.0.0 milestone Nov 12, 2026
@CaffeinatedCoder CaffeinatedCoder added bug Something isn't working silent Answers wrongly without throwing; the fix ships as a minor, never a patch package/core Affects CodoMetis.EFCore.SchemaKit (the kernel) severity/low Cosmetic, message or documentation-level difference area/constraints Exclusion constraints, row guards and other constraint-like objects labels Nov 12, 2026
@CaffeinatedCoder
CaffeinatedCoder merged commit cd2f0b5 into main Nov 12, 2026
7 checks passed
@CaffeinatedCoder
CaffeinatedCoder deleted the fix/predicate-and branch November 12, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/constraints Exclusion constraints, row guards and other constraint-like objects bug Something isn't working package/core Affects CodoMetis.EFCore.SchemaKit (the kernel) severity/low Cosmetic, message or documentation-level difference silent Answers wrongly without throwing; the fix ships as a minor, never a patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Predicate.And takes a trailing AND (x) for a top-level conjunct, whatever the precedence

1 participant