Ah thanks I had not seen this and replacing it with a non prepared version and some manual sql statement generation fixed the problem.
Thank you! On Thursday, February 16, 2017 at 6:22:27 PM UTC, Justin Israel wrote: > > > > On Fri, Feb 17, 2017, 6:48 AM <l...@pinkfroot.com <javascript:>> wrote: > >> I have a channel that receives a lot of data that needs to be stored into >> MySQL. >> >> After a short period of time I get the following... >> >> Error 1461: Can't create more than max_prepared_stmt_count statements >> (current value: 16382) >> panic: runtime error: invalid memory address or nil pointer dereference >> [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x13f7168] >> >> goroutine 61348 [running]: >> database/sql.(*Stmt).Close(0x0, 0x0, 0x0) >> /usr/local/go/src/database/sql/sql.go:2022 +0x38 >> >> I notice a few really old bugs that have been closed off but not sure why >> this is happening. >> >> I am running Go1.8rc3 >> > > What does your usage pattern look like in code? > > http://go-database-sql.org/prepared.html > > "Because statements will be re-prepared as needed when their original > connection is busy, it’s possible for high-concurrency usage of the > database, which may keep a lot of connections busy, to create a large > number of prepared statements. This can result in apparent leaks of > statements, statements being prepared and re-prepared more often than you > think, and even running into server-side limits on the number of > statements." > > Justin > > > -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.