[sr-dev] git:4.3:a06d5419: db_unixodbc: detect DB disconnection with generic HY000 status

Daniel-Constantin Mierla miconda at gmail.com
Tue Jul 5 12:06:14 CEST 2016


Module: kamailio
Branch: 4.3
Commit: a06d5419699183f98bfb4908d29bd768a0eb0a0a
URL: https://github.com/kamailio/kamailio/commit/a06d5419699183f98bfb4908d29bd768a0eb0a0a

Author: Giovanni Mele <giovanni.mele at nagra.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-07-05T11:58:24+02:00

db_unixodbc: detect DB disconnection with generic HY000 status

(cherry picked from commit d80376f9ea087328a0c46d97b908993baeb5b1b4)
(cherry picked from commit e2874495b1ecad9e85b47f6d8bdb847fceb0c3ad)

---

Modified: modules/db_unixodbc/dbase.c

---

Diff:  https://github.com/kamailio/kamailio/commit/a06d5419699183f98bfb4908d29bd768a0eb0a0a.diff
Patch: https://github.com/kamailio/kamailio/commit/a06d5419699183f98bfb4908d29bd768a0eb0a0a.patch

---

diff --git a/modules/db_unixodbc/dbase.c b/modules/db_unixodbc/dbase.c
index d5c7d27..304b4d4 100644
--- a/modules/db_unixodbc/dbase.c
+++ b/modules/db_unixodbc/dbase.c
@@ -138,7 +138,8 @@ static int db_unixodbc_submit_query(const db1_con_t* _h, const str* _s)
 
 		/* Connection broken */
 		if( !strncmp((char*)sqlstate,"08003",5) ||
-		    !strncmp((char*)sqlstate,"08S01",5)
+		    !strncmp((char*)sqlstate,"08S01",5) ||
+		    !strncmp((char*)sqlstate,"HY000",5)   /* ODBC 3 General error */
 		    )
 		{
 			ret = reconnect(_h);




More information about the sr-dev mailing list