aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_odbc.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-31 21:31:25 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-31 21:31:25 +0000
commitd1eb523ab82c73a1136416f6d327f2f04c5893db (patch)
tree0b787580c5ea59bce0e79e1a98935a37731fdfd0 /res/res_odbc.c
parent1427e43aa1ae56e7327b8c629cac71fda13a58ac (diff)
don't use 'rowcount' after SELECT statements, since the ODBC API does not say it is allowed (issue #5083)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6904 f38db490-d61c-443f-a65b-d21fe96a405b
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!*/
- }
}
}
}