aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_odbc.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_odbc.c')
-rwxr-xr-xres/res_odbc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/res/res_odbc.c b/res/res_odbc.c
index 8fcec4ffe..2b99572cd 100755
--- a/res/res_odbc.c
+++ b/res/res_odbc.c
@@ -110,7 +110,7 @@ int odbc_smart_execute(odbc_obj *obj, SQLHSTMT stmt)
{
int res = 0;
res = SQLExecute(stmt);
- if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO) && (res != SQL_NO_DATA)) {
ast_log(LOG_WARNING, "SQL Execute error! Attempting a reconnect...\n");
ast_mutex_lock(&obj->lock);
obj->up = 0;
@@ -147,7 +147,6 @@ int odbc_sanity_check(odbc_obj *obj)
char *test_sql = "select 1";
SQLHSTMT stmt;
int res = 0;
- SQLLEN rowcount = 0;
ast_mutex_lock(&obj->lock);
if(obj->up) { /* so you say... let's make sure */
@@ -162,11 +161,6 @@ int odbc_sanity_check(odbc_obj *obj)
res = SQLExecute(stmt);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
obj->up = 0; /* Liar!*/
- } else {
- res = SQLRowCount(stmt, &rowcount);
- if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
- obj->up = 0; /* Liar!*/
- }
}
}
}