Menu

#11 Return Type Error on _nss_mysql_run_query

Current Version
closed-fixed
None
5
2006-09-16
2006-06-12
Anonymous
No

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

Discussion

  • Ben Goodwin

    Ben Goodwin - 2006-09-16
    • assigned_to: nobody --> cinergi
    • status: open --> closed-fixed
     
  • Ben Goodwin

    Ben Goodwin - 2006-09-16

    Logged In: YES
    user_id=550319

    Hi!

    Thanks for the bug report and the solution! I have
    committed the change to CVS.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.