mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
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
This commit is contained in:
@@ -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!*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user