EMAIL: matteo.faleschini(AT)fisica.unimi.it
We found errors using this library with mysql cluster.
When mysqld are functioning but the storage (ndbd) is
down, we incurred in a SUCCESS of the db connection but
a FAILURE of the query
Proto of _nss_mysql_run_query
is
NSS_STATUS
_nss_mysql_run_query (char *query, MYSQL_RES **mresult,
int *attempts)
Instead the return value of this function in case of
query error is the return value of mysql_query
function. This is the mysql error code, not the
NSS_STATUS requested by the function.
retval = mysql_query (&ci.link, query);
if (retval != RETURN_SUCCESS)
{
--(*attempts);
if (*attempts > 0)
{
_nss_mysql_log (LOG_ALERT,
"mysql_query failed : %s,
trying again (%d)",
mysql_error (&ci.link),
*attempts);
DSRETURN (_nss_mysql_run_query (query,
mresult, attempts));
}
else
{
_nss_mysql_log (LOG_ALERT, "mysql_query
failed (with retval): %s",
mysql_error (&ci.link));
//DSRETURN (retval);
DSRETURN (NSS_UNAVAIL);
}
}
We solved this problem, substituting last line
Logged In: YES
user_id=550319
Hi!
Thanks for the bug report and the solution! I have
committed the change to CVS.