Explorar el Código

db_unixodbc: detect DB disconnection with generic HY000 status

Giovanni Mele hace 9 años
padre
commit
d80376f9ea
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      modules/db_unixodbc/dbase.c

+ 2 - 1
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);