Comment 2 for bug 1168150

Revision history for this message
aemil estvold (mrnitrate) wrote :

If it helps i had the same issue and the problem was with the 'fetchone()', this leaves the result set open as you have not emptied it for after the last item is a null item or resultset.

I was able to solved this by using fetchall(), even when i knew it would only return one result ie. 'select * from test where id = ? limit 1'.

fetchall() then closes the open resultset ie. the preapred_stmt that oursql uses, and fixes the (1461, "Can't create more than max_prepared_stmt_count statements (current value: 16382)") error for fetchone() does not close the prepared_stmt and eventually you hit the msyql limt of open prepared_stmt's '16382'.