MCPcopy
hub / github.com/go-sql-driver/mysql / Close

Method Close

statement.go:26–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26func (stmt *mysqlStmt) Close() error {
27 if stmt.mc == nil || stmt.mc.closed.Load() {
28 // driver.Stmt.Close could be called more than once, thus this function
29 // had to be idempotent. See also Issue #450 and golang/go#16019.
30 // This bug has been fixed in Go 1.8.
31 // https://github.com/golang/go/commit/90b8a0ca2d0b565c7c7199ffcf77b15ea6b6db3a
32 // But we keep this function idempotent because it is safer.
33 return nil
34 }
35
36 err := stmt.mc.writeCommandPacketUint32(comStmtClose, stmt.id)
37 stmt.mc = nil
38 return err
39}
40
41func (stmt *mysqlStmt) NumInput() int {
42 return stmt.paramCount

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected