I have a problem at one of our customers, who runs MySQL 5.5.8.
I have something like the following code:
MYSQL* mysql = XXX();
char* sqlQuery = "SELECT MAX(id) FROM mytable";
ret = mysql_real_query(mysql, sqlQuery, (unsigned int)strlen(sqlQuery));
if (ret != 0)
printf("### Error mysql_real_query: '%s'", mysql_error(mysql));
res = mysql_use_result(mysql);
if (res == NULL)
printf("### Error mysql_use_result: '%s'", mysql_error(mysql));
But I have the following result:
### Error mysql_use_result: ''
I don't understand why mysql_use_result would return NULL and mysql_error is not set. By the way, there is also no reason why mysql_use_result returns NULL (the table is present and the request is returning value when run manually), but that's another story...
Did you already have this problem, of having a function returning an error but the error is not set??? Where could I look to find more investigation elements?
Thanks for your attention,