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

Function extractStatementText

backend/plugin/parser/mysql/backup.go:323–333  ·  view source on GitHub ↗
(fullSQL string, loc ast.Loc)

Source from the content-addressed store, hash-verified

321}
322
323func extractStatementText(fullSQL string, loc ast.Loc) string {
324 end := loc.End
325 if end <= 0 || end > len(fullSQL) {
326 end = len(fullSQL)
327 }
328 start := 0
329 if loc.Start > 0 {
330 start = loc.Start
331 }
332 return strings.TrimSpace(fullSQL[start:end])
333}
334
335// writeSuffixSelectClause writes the FROM ... WHERE ... suffix of a DML statement.
336func writeSuffixSelectClause(buf *strings.Builder, node ast.Node, fullSQL string) error {

Callers 2

extractTablesFromDeleteFunction · 0.70
extractTablesFromUpdateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected