walker: expression WARNING diagnostics (ADR-0027 step C, folds ADR-0026 §7)
Type-mismatched comparisons and `= NULL` / `!= NULL` in a WHERE expression now yield WARNING diagnostics — the command still parses and runs (the ADR-0026 §7 permissive posture is unchanged), but the validity indicator can flag it before submission. Computed post-walk from the built command's `Expr` against the table's column types: a Compare / Between / In with a column operand and a non-null literal whose type the column cannot hold, or a Compare with `=` / `!=` against NULL. New catalog keys `diagnostic.type_mismatch` / `diagnostic.eq_null`. This is ADR-0026's deferred step 5, folded into ADR-0027's diagnostics-severity model as the user requested.
This commit is contained in:
@@ -465,6 +465,10 @@ parse:
|
||||
diagnostic:
|
||||
unknown_table: "no such table: `{name}`"
|
||||
unknown_column: "no such column `{name}` on table `{table}`"
|
||||
# WARNING-severity flags (ADR-0026 §7) — the command still
|
||||
# runs, but the comparison is very likely not intended.
|
||||
type_mismatch: "`{column}` is {type} — this comparison uses a value of a different type"
|
||||
eq_null: "`= NULL` is never true — use `IS NULL` or `IS NOT NULL`"
|
||||
|
||||
# ---- Project lifecycle event notes -----------------------------------
|
||||
project:
|
||||
|
||||
Reference in New Issue
Block a user