Bug #62098 Commands out of sync; you can't run this command now SQL State: HY000
Submitted: 5 Aug 2011 20:26 Modified: 6 Sep 2011 8:57
Reporter: Robert Gebis Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S2 (Serious)
Version:5.5.15 OS:Linux (CentOS x64 5.6)
Assigned to: CPU Architecture:Any
Tags: 2014, hy000, out of sync

[5 Aug 2011 20:26] Robert Gebis
Description:
Since I upgraded to 5.5.15 yesterday some of my program started getting this error.
My programs were running to several months and I did not see anything like that. There were no changes to my conf file rather since upgrade from 5.5.13. I do upgrade every other version. And even previous versions I did not see this.

Here is the error while executing stored procedure

SqlErr: 2014, Commands out of sync; you can't run this command now SQL State: HY000

Is this a C API or server error. Nothing in mysqld.log saying there were errors.

How to repeat:
Not sure. I am just running my code and it just showed up.

Suggested fix:
Not sure.
[6 Aug 2011 8:57] Valeriy Kravchuk
Read this carefully, to begin with: http://dev.mysql.com/doc/refman/5.5/en/threaded-clients.html

Namely:

"If you want to use multiple threads on the same connection, you must have a mutex lock around your pair of mysql_query() and mysql_store_result() calls. Once mysql_store_result() is ready, the lock can be released and other threads may query the same connection."

Are you sure that other thread do not use connection between calls to mysql_query() and mysql_store_result() in a given thread?
[6 Sep 2011 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".