-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug: Nothing auto-releases statement #76
Comments
The protocol docs don't say much about it, but according to the SQL docs, it does NOT get cleared until the session is terminated (I assume that means connection): http://dev.mysql.com/doc/refman/5.7/en/deallocate-prepare.html On the bright side, prepared statements are specific to a session, and the (adjustable) prepared statement limit is per-session, not per-server. So I don't think it's a big problem since the user is still in control of it. But still, sounds like these really should get auto-released when possible. |
This should be fixed in the new design, too. The new interface for prepared statements, Prepared, is reference-counted and releases itself in its dtor. |
Fixed in v1.0.0 |
Awesome. Sorry haven't had a chance to look at this, I've had to stick with the old API for now. But I will invest some time soon to try and migrate all my stuff over. |
Command has a function releaseStatement which is supposed to clear the server resource handle for the prepared statement.
There's nothing that automatically does this. Shouldn't the command have a destructor that does this? ResultSequence purges the command, but does not release the statement (and it shouldn't, because you may go and re-execute a new result sequence!). In addition, there's no way to tell if it needs to release a statement (no way to see if it's a prepared statement or not).
I don't know what the protocol specifies. Maybe statements expire after some time and it's not required to clean it up? This is why I say "possible bug".
The text was updated successfully, but these errors were encountered: