summaryrefslogtreecommitdiff
path: root/res/res_odbc.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2005-10-31 21:31:25 +0000
committerKevin P. Fleming <kpfleming@digium.com>2005-10-31 21:31:25 +0000
commit551ac9af0465d6d64635e120822069008d569ada (patch)
tree0b787580c5ea59bce0e79e1a98935a37731fdfd0 /res/res_odbc.c
parentc3f9388b2399a5db44ee464d5c20276763aa75f1 (diff)
don't use 'rowcount' after SELECT statements, since the ODBC API does not say it is allowed (issue #5083)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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!*/
- }
}
}
}