-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
In postgres and some others, EXPLAIN ANALYZE executes the query it's explaining, which might itself not be a read query. For example:
EXPLAIN ANALYZE DELETE FROM abc;...will actually delete from the table, but sqlparser classifies it as OtherRead rather than Delete. It's possible this is intentional, as EXPLAIN ANALYZE results in an explanation meant to be read, but it's also unintuitive here, since the underlying query is not a read operation. In the above, not even walking the tree exposes the DELETE part.
I would like a way to verify read-only SELECTs, DESCRIBEs and non-mutating EXPLAINs, but I don't think I can do that simply with a type switch, as OtherRead won't capture the mutating EXPLAIN ANALYZE case.
Metadata
Metadata
Assignees
Labels
No labels