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

Function trimMySQLLocSpace

backend/plugin/db/mysql/query.go:245–253  ·  view source on GitHub ↗
(sql string, loc ast.Loc)

Source from the content-addressed store, hash-verified

243}
244
245func trimMySQLLocSpace(sql string, loc ast.Loc) ast.Loc {
246 for loc.Start < loc.End && loc.Start < len(sql) && (sql[loc.Start] == ' ' || sql[loc.Start] == '\t' || sql[loc.Start] == '\n' || sql[loc.Start] == '\r') {
247 loc.Start++
248 }
249 for loc.End > loc.Start && loc.End <= len(sql) && (sql[loc.End-1] == ' ' || sql[loc.End-1] == '\t' || sql[loc.End-1] == '\n' || sql[loc.End-1] == '\r') {
250 loc.End--
251 }
252 return loc
253}
254
255func maxMySQLLocEndBeforeTailClauses(node ast.Node) int {
256 maxEnd := -1

Callers 1

rewriteMySQLSelectLimitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected