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

Function nodeStmtLoc

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

nodeStmtLoc returns the source Loc of a DML statement node.

(node ast.Node)

Source from the content-addressed store, hash-verified

447
448// nodeStmtLoc returns the source Loc of a DML statement node.
449func nodeStmtLoc(node ast.Node) ast.Loc {
450 switch n := node.(type) {
451 case *ast.UpdateStmt:
452 return n.Loc
453 case *ast.DeleteStmt:
454 return n.Loc
455 }
456 return ast.Loc{}
457}
458
459func parseCTEPrefix(fullSQL string, stmtLoc ast.Loc) []*ast.CommonTableExpr {
460 if stmtLoc.Start <= 0 || stmtLoc.Start > len(fullSQL) {

Callers 2

writeCTEPrefixFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected