MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / ReleaseStatements

Function ReleaseStatements

pkg/sql/ast/pool.go:491–499  ·  view source on GitHub ↗

ReleaseStatements returns a slice of statements back to their respective pools. Use this to clean up statements returned by ParseWithRecovery, which returns []Statement rather than an *AST. Example: stmts, errs := parser.ParseWithRecovery(tokens) defer ast.ReleaseStatements(stmts) // ... proces

(stmts []Statement)

Source from the content-addressed store, hash-verified

489// defer ast.ReleaseStatements(stmts)
490// // ... process stmts and errs ...
491func ReleaseStatements(stmts []Statement) {
492 for i := range stmts {
493 if stmts[i] == nil {
494 continue
495 }
496 releaseStatement(stmts[i])
497 stmts[i] = nil
498 }
499}
500
501// releaseStatement returns a single Statement to its pool.
502// This is the central dispatch used by both ReleaseAST and ReleaseStatements.

Callers 2

TestReleaseStatementsFunction · 0.85

Calls 1

releaseStatementFunction · 0.85

Tested by 2

TestReleaseStatementsFunction · 0.68