[Freeswitch-svn] [commit] r11244 - freeswitch/trunk/src

FreeSWITCH SVN anthm at freeswitch.org
Thu Jan 15 15:40:11 PST 2009


Author: anthm
Date: Thu Jan 15 17:40:11 2009
New Revision: 11244

Log:
fix ignored error condition bug reported on the dev list

Modified:
   freeswitch/trunk/src/switch_odbc.c

Modified: freeswitch/trunk/src/switch_odbc.c
==============================================================================
--- freeswitch/trunk/src/switch_odbc.c	(original)
+++ freeswitch/trunk/src/switch_odbc.c	Thu Jan 15 17:40:11 2009
@@ -331,7 +331,8 @@
 	SQLLEN m = 0, t = 0;
 	char *err_str = NULL;
 	int result;
-
+	int err = 0;
+	
 	switch_assert(callback != NULL);
 
 	if (!db_is_up(handle)) {
@@ -366,6 +367,7 @@
 		int done = 0;
 
 		if (!(result = SQLFetch(stmt)) == SQL_SUCCESS) {
+			err++;
 			break;
 		}
 
@@ -407,9 +409,11 @@
 	
 	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 */
 	if (err_str != NULL) {



More information about the Freeswitch-svn mailing list