isReadOnlySelect returns true for SELECT statements without an INTO target. Non-SELECT nodes and SELECT ... INTO are rejected — INTO materialises a new table which is a DDL-like side effect.
(node ast.Node)
| 38 | // Non-SELECT nodes and SELECT ... INTO are rejected — INTO materialises a new |
| 39 | // table which is a DDL-like side effect. |
| 40 | func isReadOnlySelect(node ast.Node) bool { |
| 41 | sel, ok := node.(*ast.SelectStmt) |
| 42 | if !ok { |
| 43 | return false |
| 44 | } |
| 45 | return !HasSelectInto(sel) |
| 46 | } |
| 47 | |
| 48 | // HasSelectInto reports whether sel (or any branch of its set operations) |
| 49 | // carries an INTO clause. |
no test coverage detected