[icinga-checkins] icinga.org: icinga-core/test/ido: idoutils: oracle fixes
git at icinga.org
git at icinga.org
Wed Aug 3 12:51:23 CEST 2011
Module: icinga-core
Branch: test/ido
Commit: e9b668aba1d29eaaf9fdc479a58a026d84ff9b8c
URL: https://git.icinga.org/?p=icinga-core.git;a=commit;h=e9b668aba1d29eaaf9fdc479a58a026d84ff9b8c
Author: Thomas Dressler <tdressler at tdressler.net>
Date: Wed Aug 3 11:10:10 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 | 11 ++++++++---
module/idoutils/src/dbhandlers.c | 2 +-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/module/idoutils/src/db.c b/module/idoutils/src/db.c
index 6ad5743..3f34764 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,6 +2988,10 @@ void ido2db_ocilib_err_handler(OCI_Error *err) {
if (st) {
sql= OCI_GetSql(st);
err_pos=OCI_GetSqlErrorPos(st);
+ /* todo needs to be checked,
+ * OCI_GetBatchErrorCount(st) works not as expected
+ */
+ /*
arrsize=OCI_BindArrayGetSize(st);
if (arrsize>0) {
arrerrcount=OCI_GetBatchErrorCount(st);
@@ -3000,6 +3004,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