fix: return 422 on invalid SQL (#34303)

This commit is contained in:
Beto Dealmeida
2025-07-24 16:40:56 -04:00
committed by GitHub
parent 3177131d52
commit b794b192d1
6 changed files with 340 additions and 4 deletions

View File

@@ -644,7 +644,7 @@ class SQLStatement(BaseSQLStatement[exp.Expression]):
# depending on the dialect (Oracle, MS SQL) the `ALTER` is parsed as a
# command, not an expression - check at root level
if isinstance(self._parsed, exp.Command) and self._parsed.name == "ALTER":
return True
return True # pragma: no cover
# Postgres runs DMLs prefixed by `EXPLAIN ANALYZE`, see
# https://www.postgresql.org/docs/current/sql-explain.html