containsTable checks whether the given AST node MUTATES the specified table (not merely references it via JOIN/USING). For UPDATE: the table must appear as the qualifier of at least one SET assignment — being only joined for filtering is not enough.
(node ast.Node, database, table string, targetCols map[string]bool)
| 513 | // For UPDATE: the table must appear as the qualifier of at least one SET |
| 514 | // assignment — being only joined for filtering is not enough. |
| 515 | func containsTable(node ast.Node, database, table string, targetCols map[string]bool) bool { |
| 516 | switch n := node.(type) { |
| 517 | case *ast.UpdateStmt: |
| 518 | return updateMutatesTable(n, database, table, targetCols) |
| 519 | case *ast.DeleteStmt: |
| 520 | return deleteMutatesTable(n, database, table) |
| 521 | default: |
| 522 | } |
| 523 | return false |
| 524 | } |
| 525 | |
| 526 | // deleteMutatesTable reports whether the DELETE removes rows from the specified |
| 527 | // physical table. |
no test coverage detected