sha174n opened a new pull request, #44072: URL: https://github.com/apache/superset/pull/44072
`SQLStatement.is_mutating()` (and therefore `has_mutation()` and the read-only consumers built on it) did not classify a few statement forms as mutating: - SQLite `ATTACH` / `DETACH` — parsed as structured `exp.Attach` / `exp.Detach` nodes, which were absent from the mutating node set. - MySQL `REPLACE INTO ...` and `RENAME TABLE ...` — fall back to an opaque `exp.Command` whose head (`REPLACE` / `RENAME`) was not in the mutating command names. - MySQL `SET PASSWORD FOR ... = ...` — reaches the opaque-command SET/RESET path, but MySQL was not in the set of dialects for which that path is treated as mutating (only PostgreSQL and StarRocks were). This adds `exp.Attach`/`exp.Detach` to the mutating node set, `REPLACE`/`RENAME` to the mutating command names, and `MySQL` to the SET/RESET mutating dialects. All three additions are consistent with the existing, documented reasoning in the file (structured nodes with no read-only form; opaque-command heads with no read form; dialects where ordinary `SET var = value` parses as `exp.Set` so only the dangerous forms reach the command fallback). Behavior-preserving: the `REPLACE()` string function inside a `SELECT` remains a read (guarded by an added test); ordinary `SET var = value` and `PRAGMA table_info(...)` are unaffected. Adds unit coverage for each new mutating form. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
