提交 57e58a7c authored 作者: Anthony Minessale's avatar Anthony Minessale

fix ignored error condition bug reported on the dev list

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11244 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 0564b6cc
...@@ -331,7 +331,8 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c ...@@ -331,7 +331,8 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c
SQLLEN m = 0, t = 0; SQLLEN m = 0, t = 0;
char *err_str = NULL; char *err_str = NULL;
int result; int result;
int err = 0;
switch_assert(callback != NULL); switch_assert(callback != NULL);
if (!db_is_up(handle)) { if (!db_is_up(handle)) {
...@@ -366,6 +367,7 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c ...@@ -366,6 +367,7 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c
int done = 0; int done = 0;
if (!(result = SQLFetch(stmt)) == SQL_SUCCESS) { if (!(result = SQLFetch(stmt)) == SQL_SUCCESS) {
err++;
break; break;
} }
...@@ -407,9 +409,11 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c ...@@ -407,9 +409,11 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c
SQLFreeHandle(SQL_HANDLE_STMT, stmt); SQLFreeHandle(SQL_HANDLE_STMT, stmt);
return SWITCH_ODBC_SUCCESS; if (!err) {
return SWITCH_ODBC_SUCCESS;
}
error: error:
/* err_str is already defined for some error cases */ /* err_str is already defined for some error cases */
if (err_str != NULL) { if (err_str != NULL) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论