We developed a small patch to check if there is a second result set when the first result set has zero rows. It's pretty specific and probably shouldn't be merged, but might help someone else if they are stuck in a similar situation.
modules/db_mysql/dbase.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/db_mysql/dbase.c b/modules/db_mysql/dbase.c index cb2abcff3..e487c2ed1 100644 --- a/modules/db_mysql/dbase.c +++ b/modules/db_mysql/dbase.c @@ -863,8 +863,17 @@ static int db_mysql_store_result(const db_con_t* _h, db_res_t** _r) return -2; } - if (!CON_HAS_PS(_h)) - CON_RESULT(_h) = mysql_store_result(CON_CONNECTION(_h)); + if (!CON_HAS_PS(_h)) { + CON_RESULT(_h) = mysql_store_result(CON_CONNECTION(_h)); + int currentRes = mysql_num_rows(CON_RESULT(_h)); + if(currentRes == 0) { + int next = mysql_next_result(CON_CONNECTION(_h)); + if(next == 0) { + CON_RESULT(_h) = mysql_store_result(CON_CONNECTION(_h)); + } + } + } + if (!CON_RESULT(_h)) { if (mysql_errno(CON_CONNECTION(_h)) > 0) { LM_ERR("driver error: %s\n", mysql_error(CON_CONNECTION(_h))); -- Regards, Calvin Ellison Senior Voice Operations Engineer calvin.elli...@voxox.com _______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users