Module: sip-router
Branch: master
Commit: 37f0964278e925d5530563b38c82a57de1f7fa59
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=37f0964…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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
---
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 cf22e4c..d2ef5c5 100644
--- a/modules/db_mysql/km_dbase.c
+++ b/modules/db_mysql/km_dbase.c
@@ -258,7 +258,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);
}
@@ -268,7 +268,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);
}