[icinga-checkins] icinga.org: icinga-core/test/cgis: idoutils: oracle fixes

git at icinga.org git at icinga.org
Thu Aug 4 01:11:07 CEST 2011


Module: icinga-core
Branch: test/cgis
Commit: 786ead84f3b52d69fcedeec5f03aec494baa18ac
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=786ead84f3b52d69fcedeec5f03aec494baa18ac

Author: Thomas Dressler <tdressler at tdressler.net>
Date:   Wed Aug  3 11:52:19 2011 +0200

idoutils:  oracle fixes
fixes SEGV for runtimevariables #1110
remove batch error handling because of internal errors #1377
refs #1377, #1110

---

 module/idoutils/src/db.c         |   10 ++++++----
 module/idoutils/src/dbhandlers.c |    2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/module/idoutils/src/db.c b/module/idoutils/src/db.c
index 6ad5743..3d8dc46 100644
--- a/module/idoutils/src/db.c
+++ b/module/idoutils/src/db.c
@@ -2966,15 +2966,15 @@ int ido2db_check_dbd_driver(void) {
 
 void ido2db_ocilib_err_handler(OCI_Error *err) {
 	OCI_Statement *st=NULL;
-	OCI_Error *arrerr;
+//	OCI_Error *arrerr;
 	const mtext *sql = "";
 	unsigned int  err_type;
 	const char * err_msg;
 	char * errt_msg = NULL;
 	char * buf=NULL;
 	char * binds=NULL;
-	int arrerrcount=0;
-	int arrsize=0;
+//	int arrerrcount=0;
+//	int arrsize=0;
 	unsigned int err_pos=0;
 	err_type = OCI_ErrorGetType(err);
 	err_msg  = OCI_ErrorGetString(err);
@@ -2988,7 +2988,8 @@ void ido2db_ocilib_err_handler(OCI_Error *err) {
 	if (st) {
 		sql= OCI_GetSql(st);
 		err_pos=OCI_GetSqlErrorPos(st);
-		arrsize=OCI_BindArrayGetSize(st);
+/* todo check array error implementation. OCI_BatchErrorCount throws errors */
+/*		arrsize=OCI_BindArrayGetSize(st);
 		if (arrsize>0) {
 			arrerrcount=OCI_GetBatchErrorCount(st);
 			if (arrerrcount>0){
@@ -3000,6 +3001,7 @@ void ido2db_ocilib_err_handler(OCI_Error *err) {
 				}
 			}
 		}
+*/
 		if (OCI_GetBindCount(st)>0) {
 			binds=malloc(OCI_VARCHAR_SIZE*16);
 			if (binds==NULL) {
diff --git a/module/idoutils/src/dbhandlers.c b/module/idoutils/src/dbhandlers.c
index 107707d..d3d7f35 100644
--- a/module/idoutils/src/dbhandlers.c
+++ b/module/idoutils/src/dbhandlers.c
@@ -5310,7 +5310,7 @@ int ido2db_handle_runtimevariables(ido2db_idi *idi) {
 #ifdef USE_ORACLE /* Oracle ocilib specific */
 		ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_handle_runtimevariables"
 				"(Pos %lu) Id=%lu %s=%s\n",
-					arrsize+count,idi->dbinfo.instance_id,es[1],es[2]);
+					arrsize+count,idi->dbinfo.instance_id,es[0],es[1]);
 		/* copy instanceid and configfile_id to array */
 		instid_arr[arrsize]=idi->dbinfo.instance_id;
 





More information about the icinga-checkins mailing list