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

Function isOverwritingInsert

backend/plugin/parser/tidb/backup.go:159–161  ·  view source on GitHub ↗

isOverwritingInsert reports whether an INSERT can overwrite or delete existing rows (REPLACE, or INSERT ... ON DUPLICATE KEY UPDATE), which prior backup cannot back up. A plain INSERT only adds rows.

(n *ast.InsertStmt)

Source from the content-addressed store, hash-verified

157// existing rows (REPLACE, or INSERT ... ON DUPLICATE KEY UPDATE), which prior
158// backup cannot back up. A plain INSERT only adds rows.
159func isOverwritingInsert(n *ast.InsertStmt) bool {
160 return n.IsReplace || len(n.OnDuplicateKey) > 0
161}
162
163// identifierKey normalizes an identifier for use as a map key/lookup, honoring
164// the instance's case sensitivity. TiDB resolves table-name and alias

Callers 1

extractTablesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected