Module: sip-router Branch: 4.1 Commit: af4f84b84ca7601bd8124fe2e82d0718c7975313 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=af4f84b8...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Tue May 27 12:07:42 2014 +0200
db_mysql: proper handling of mysql_next_result(...) return code
- it indicates the presence of another result if return is 0 - reported by Maxim (simax), FS#434
(cherry picked from commit 37f0964278e925d5530563b38c82a57de1f7fa59)
---
modules/db_mysql/km_dbase.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/db_mysql/km_dbase.c b/modules/db_mysql/km_dbase.c index a1e7ac7..688d433 100644 --- a/modules/db_mysql/km_dbase.c +++ b/modules/db_mysql/km_dbase.c @@ -197,7 +197,7 @@ static int db_mysql_store_result(const db1_con_t* _h, db1_res_t** _r) db_mysql_free_result(_h, *_r); *_r = 0; #if (MYSQL_VERSION_ID >= 40100) - while( mysql_more_results(CON_CONNECTION(_h)) && mysql_next_result(CON_CONNECTION(_h)) > 0 ) { + while( mysql_more_results(CON_CONNECTION(_h)) && mysql_next_result(CON_CONNECTION(_h)) == 0 ) { MYSQL_RES *res = mysql_store_result( CON_CONNECTION(_h) ); mysql_free_result(res); } @@ -207,7 +207,7 @@ static int db_mysql_store_result(const db1_con_t* _h, db1_res_t** _r)
done: #if (MYSQL_VERSION_ID >= 40100) - while( mysql_more_results(CON_CONNECTION(_h)) && mysql_next_result(CON_CONNECTION(_h)) > 0 ) { + while( mysql_more_results(CON_CONNECTION(_h)) && mysql_next_result(CON_CONNECTION(_h)) == 0 ) { MYSQL_RES *res = mysql_store_result( CON_CONNECTION(_h) ); mysql_free_result(res); }