C API Commands out of sync error
Posted by: John Wythe
Date: December 29, 2018 12:06PM

I am using the C API. My first call to mysql_real_query fails with this error, on a system running MySQL 5.1.73, but not MySQL 5.0.51a-0 or 4.1.22. I have tried compiling against the 4.1.22 libraries, and the 5.0.51a libraries. Both give the same error. I find it strange that this program works on many other systems, but not this one using 5.1.73. I have not done a lot of extensive testing with different systems and different versions of MySQL. So far only three where I know the versions. Most of our systems are either running 4.1.22 or 5.0.xx. Not many are running 5.1.xx or 5.5.xx. I am going to try compiling and linking on the system with the problem to see if that helps.

All our systems are running some version of Redhat/CentOS from 4.x to 6.x. The system in question is running 6.x. MySQL on all systems are downloaded from compiled versions out there on the internet or the RPMs from Redhat/CentOS for that version of Linux using yum or up2date.

I have done the mysql_init and the mysql_real_connect. before doing the mysql_real_query.

I have read up a number of other posts about this error re multiple queries. I do not believe this is my problem for 2 reasons.
1) program works when run against other versions of MySQL on different systems mind you.
2)This is my first call to mysql_real_query, so no previous query, at least that I initiated.

Perhaps a bug in the MySQL client library when run against MySQL 5.1. Further testing may confirm this.

one other library call I make between the init and the query is:

This call is made based on a flag setting, so I will have to verify if this call is being made in this case, and not others, or vice versa.

Options: ReplyQuote

Written By
C API Commands out of sync error
December 29, 2018 12:06PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.