fix: address code review findings for ClickHouse driver (SQL parsing, nullable regression)
Description
Follow-up fixes from 6-model consensus code review of PR #591.
Issues Found by Review Panel
-
CRITICAL —
LowCardinality(Nullable(...))nullable regression: regex/^Nullable\b/misclassifiesLowCardinality(Nullable(String))as non-nullable.LowCardinalityis a storage optimization — the column IS nullable. -
MAJOR — Trailing comment hides injected LIMIT:
SELECT * FROM t -- note+ appendedLIMIT 1001= LIMIT inside comment, query runs unlimited. Fix: append with newline. -
MAJOR — Leading comment bypasses
supportsLimit:-- comment\nSELECT *fails/^\s*(SELECT|WITH)/regex. Fix: run checks on comment-stripped SQL. -
MAJOR — Comment stripping doesn't respect string literals:
SELECT '-- LIMIT' FROM thas string content corrupted. Fix: strip strings before comments.
Review Panel
Claude, GPT 5.2 Codex, Gemini 3.1 Pro, Kimi K2.5, MiniMax M2.5, GLM-5 (6 models, 1 convergence round)