Prepare statements are leaking whenever an UPDATE is made. The statements are getting closed for queries (q _Query) query(...)but not for any updates made (q _Query) exec(...) see modelq/gmq/package.go. The prepares get deallocated whenever the connection disappears, but in the case that the connection persists and many updates are being done via transactions, we will eventually hit the maximum number of prepared statements (which by default is 13682) and receive error 1461. This shouldn't happen. A workaround would be to increase the limit, but the preferred way would be to close the statement when it's finished.
Prepare statements are leaking whenever an UPDATE is made. The statements are getting closed for queries
(q _Query) query(...)
but not for any updates made(q _Query) exec(...)
seemodelq/gmq/package.go
. The prepares get deallocated whenever the connection disappears, but in the case that the connection persists and many updates are being done via transactions, we will eventually hit the maximum number of prepared statements (which by default is 13682) and receive error 1461. This shouldn't happen. A workaround would be to increase the limit, but the preferred way would be to close the statement when it's finished.https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html#statvar_Prepared_stmt_count