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:
claude@clouddev1
2026-05-19 07:21:30 +00:00
parent 827b47f88f
commit 73c74701c2
3 changed files with 236 additions and 2 deletions
+4
View File
@@ -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: