MCPcopy Create free account
hub / github.com/bytebase/bytebase / containsTable

Function containsTable

backend/plugin/parser/tidb/restore.go:515–524  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
515func 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.

Callers 2

findMatchingDMLsFunction · 0.70
extractStatementFunction · 0.70

Calls 2

updateMutatesTableFunction · 0.85
deleteMutatesTableFunction · 0.85

Tested by

no test coverage detected