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
This commit is contained in:
Anthony Minessale 2009-01-15 23:40:11 +00:00
parent 0564b6ccd3
commit 57e58a7cb1

View File

@ -331,6 +331,7 @@ 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);
@ -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,7 +409,9 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c
SQLFreeHandle(SQL_HANDLE_STMT, stmt); SQLFreeHandle(SQL_HANDLE_STMT, stmt);
if (!err) {
return SWITCH_ODBC_SUCCESS; return SWITCH_ODBC_SUCCESS;
}
error: error: