You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enforce Msg 8141 at CREATE TABLE — reject inline column-level CHECK predicates that reference any column other than the owning column. Structural walk via Expression.VisitColumnReferences (Reference / Parenthesized / TwoSidedExpression / Cast / Length covered) + BooleanExpression.VisitOperandExpressions (every subclass). Coverage gap documented: peer refs buried in less-common containers (DATEPART, SUBSTRING, nested CASE, JSON, etc.) still escape and surface at INSERT.
Copy file name to clipboardExpand all lines: CLAUDE.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -237,7 +237,7 @@ NOT swallowed: Msg 529 (explicit-cast disallowed pair like `int → date`), Msg
237
237
String-source truncation isn't a "conversion failure" path either way — `TRY_CAST('hello' AS varchar(3))` → `'hel'`. EF doesn't emit TRY_CAST/TRY_CONVERT from idiomatic LINQ (raw SQL only).
238
238
239
239
### Constraints
240
-
-`CHECK`: inline single-column and table-level forms; Msg 547 per row on definitely-false predicate.
240
+
-`CHECK`: inline single-column and table-level forms; Msg 547 per row on definitely-false predicate. Inline column-level CHECK predicates may only reference their owning column — peer references raise **Msg 8141** at CREATE TABLE (probe-confirmed verbatim wording). The walker is structural via `Expression.VisitColumnReferences` + `BooleanExpression.VisitOperandExpressions`; coverage is currently limited to common container subclasses (`Reference`, `Parenthesized`, `TwoSidedExpression`, `Cast`, `Length`) — peer refs buried in less-common containers (`DATEPART`, `SUBSTRING`, nested `CASE`, etc.) silently escape the CREATE-TABLE check and surface at INSERT instead. Table-level CHECK has no peer restriction.
241
241
-`PRIMARY KEY` / `UNIQUE`: linear scan (O(N) per insert); no B-tree.
242
242
243
243
### Transactions
@@ -420,7 +420,6 @@ Full `DbDataReader` contract. Typed accessors read `SqlValue` directly via the c
0 commit comments