Skip to content

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

Closed

Description

@CaffeinatedCoder

Found by the analysis of #77 and #79.

What happens

Predicate.And leaves the predicate as it is when its text ends in AND (other). That is 5.x's rule, and it takes the ending for a top-level conjunct whatever stands before it.

new Predicate("{A} OR {B} AND ({C})").And(new Predicate("{C}")) returns {A} OR {B} AND ({C}), which is A OR (B AND C). The condition is wider than the one asked for, so a constraint or a unique index covers rows the caller excluded, and nothing fails.

The translator parenthesises every OR, so only a predicate written by hand reaches this.

Fix

Take for a conjunct only what And itself writes: a template of the form (…) AND (other) whose first parenthesis closes right before AND.

Tests

The case above, and that the result of And is still recognised when the same predicate is added again.

Activity

  1. added this to the 11.0.0 milestone on Nov 12, 2026
  2. added
    bug
    silent
    package/core
    severity/low
    area/constraints
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/constraintsbugpackage/coreseverity/lowsilent

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions