Repository navigation
fix(ai): run_sql reruns misspelt column names and keeps internal SQL out of errors - #1959
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Oct 30, 2026 in 1m 36s
Confidence 10/10 · No issues found
🟢 Confidence 10/10 · safe to merge
New guard only declines rewrites, and the added test fails without it; earlier regex edge cases are pinned by behaviour tests.
no findings · tests covered · risk low
run_sql now rewrites an unambiguous misspelt column and reruns, and scrubs internal SQL out of warehouse errors. The change since the last review only adds a guard that declines a qualified fix when its qualifier names two relations, and it is correct.
fixUnknownIdentifierdeclines a qualified rewrite whenqualifierReusedsees the qualifier bound by two relationssql-identifiers.test.tspins the CTE-plus-table qualifier case
What was checked
- Walked the new CTE case through
identifierFixwithout the guard: it rewrote all threet.span_nameuses, so the test does fail withoutqualifierReused identifierTextkeeps every position when blanking literals/comments and unquoting backticks, soreplaceIdentifierspans line up withsql- Global
SQL_TOKEN/RELATIONregexes are only used throughreplace/matchAll, which do not carrylastIndexbetween calls
414492e · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading