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

Function PutUpdateStatement

pkg/sql/ast/pool.go:585–606  ·  view source on GitHub ↗

PutUpdateStatement returns an UpdateStatement to the pool

(stmt *UpdateStatement)

Source from the content-addressed store, hash-verified

583
584// PutUpdateStatement returns an UpdateStatement to the pool
585func PutUpdateStatement(stmt *UpdateStatement) {
586 if stmt == nil {
587 return
588 }
589
590 // Clean up expressions
591 for i := range stmt.Assignments {
592 PutExpression(stmt.Assignments[i].Column)
593 PutExpression(stmt.Assignments[i].Value)
594 stmt.Assignments[i].Column = nil
595 stmt.Assignments[i].Value = nil
596 }
597 PutExpression(stmt.Where)
598
599 // Reset fields
600 stmt.Assignments = stmt.Assignments[:0]
601 stmt.Where = nil
602 stmt.TableName = ""
603
604 // Return to pool
605 updateStmtPool.Put(stmt)
606}
607
608// GetDeleteStatement gets a DeleteStatement from the pool
609func GetDeleteStatement() *DeleteStatement {

Callers 3

releaseStatementFunction · 0.85
TestUpdateStatementPoolFunction · 0.85

Calls 2

PutExpressionFunction · 0.85
PutMethod · 0.80

Tested by 2

TestUpdateStatementPoolFunction · 0.68