提交 854f3f64 authored 作者: Anthony Minessale's avatar Anthony Minessale

FSCORE-276

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11331 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 4b51419e
......@@ -32,6 +32,10 @@
#include <switch.h>
#include <switch_odbc.h>
#if (ODBCVER < 0x0300)
#define SQL_NO_DATA SQL_SUCCESS
#endif
struct switch_odbc_handle {
char *dsn;
char *username;
......@@ -222,6 +226,10 @@ static int db_is_up(switch_odbc_handle_t *handle)
result = SQLExecute(stmt);
if (result != SQL_SUCCESS && result != SQL_SUCCESS_WITH_INFO) {
goto error;
}
SQLRowCount (stmt, &m);
rc = SQLNumResultCols (stmt, &nresultcols);
if (rc != SQL_SUCCESS){
......@@ -351,7 +359,7 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c
result = SQLExecute(stmt);
if (result != SQL_SUCCESS && result != SQL_SUCCESS_WITH_INFO) {
if (result != SQL_SUCCESS && result != SQL_SUCCESS_WITH_INFO && result != SQL_NO_DATA) {
goto error;
}
......@@ -366,8 +374,12 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c
int y = 0;
int done = 0;
if (!(result = SQLFetch(stmt)) == SQL_SUCCESS) {
err++;
result = SQLFetch(stmt);
if (result != SQL_SUCCESS) {
if (result != SQL_NO_DATA){
err++;
}
break;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论