[icinga-checkins] icinga.org: icinga-core/mfriedrich/ido: idoutils: fix wrong lob variable assignments, set lob chunk size back to 2048

git at icinga.org git at icinga.org
Wed Apr 4 13:47:08 CEST 2012


Module: icinga-core
Branch: mfriedrich/ido
Commit: 0906122b88ad76e62473c29af02b7c0eacadef59
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=0906122b88ad76e62473c29af02b7c0eacadef59

Author: Thomas Dressler <tdressler at tdressler.net>
Date:   Tue Apr  3 20:48:27 2012 +0200

idoutils:fix wrong lob variable assignments, set lob chunk size back to 2048
refs #2303, #2342

---

 module/idoutils/include/db.h    |    2 +-
 module/idoutils/src/dbqueries.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/module/idoutils/include/db.h b/module/idoutils/include/db.h
index 11e9253..2429c4f 100644
--- a/module/idoutils/include/db.h
+++ b/module/idoutils/include/db.h
@@ -167,7 +167,7 @@ int ido2db_db_trim_data_table(ido2db_idi *,char *,char *,unsigned long);
 #define OCI_STR_SIZE 256 /* default small string buffer size */
 #define OCI_BINDARRAY_MAX_SIZE 5000 /* default array buffer and commit size for bulk ops */
 #define OCI_OUTPUT_BUFFER_SIZE 32000 /* Buffer size for dbms_output calls */
-#define OCI_LOB_CHUNK_SIZE 16 /* Buffer size for LOB operations */
+#define OCI_LOB_CHUNK_SIZE 2048 /* Buffer size for LOB operations */
 
 void ido2db_ocilib_err_handler(OCI_Error *);
 unsigned long ido2db_oci_sequence_lastid(ido2db_idi *, char *);
diff --git a/module/idoutils/src/dbqueries.c b/module/idoutils/src/dbqueries.c
index 9da6e4c..82ffdbe 100644
--- a/module/idoutils/src/dbqueries.c
+++ b/module/idoutils/src/dbqueries.c
@@ -3461,8 +3461,8 @@ int ido2db_query_insert_or_update_hoststatusdata_add(ido2db_idi *idi, void **dat
 	lob_pi = OCI_LobCreate(idi->dbinfo.oci_connection, OCI_CLOB);
 	lob_pu = OCI_LobCreate(idi->dbinfo.oci_connection, OCI_CLOB);
 
-	result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_hoststatus, ":X5i", *(char **)data[4], &lob_pi);
-	if (result == IDO_OK) result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_hoststatus, ":X5u", *(char **)data[4], &lob_pu);
+	result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_hoststatus, ":X5i", *(char **)data[4], &lob_li);
+	if (result == IDO_OK) result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_hoststatus, ":X5u", *(char **)data[4], &lob_lu);
 	if (result == IDO_OK) result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_hoststatus, ":X6i", *(char **)data[5], &lob_pi);
 	if (result == IDO_OK) result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_hoststatus, ":X6u", *(char **)data[5], &lob_pu);
 	if (result == IDO_OK) {
@@ -3960,8 +3960,8 @@ int ido2db_query_insert_or_update_servicestatusdata_add(ido2db_idi *idi, void **
 	lob_pu = OCI_LobCreate(idi->dbinfo.oci_connection, OCI_CLOB);
 
 	ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_servicestatus() bind clobs\n");
-	result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_servicestatus, ":X5i", *(char **)data[4], &lob_pi);
-	if (result == IDO_OK) result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_servicestatus, ":X5u", *(char **)data[4], &lob_pu);
+	result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_servicestatus, ":X5i", *(char **)data[4], &lob_li);
+	if (result == IDO_OK) result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_servicestatus, ":X5u", *(char **)data[4], &lob_lu);
 	if (result == IDO_OK) result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_servicestatus, ":X6i", *(char **)data[5], &lob_pi);
 	if (result == IDO_OK) result = ido2db_oci_bind_clob(idi->dbinfo.oci_statement_servicestatus, ":X6u", *(char **)data[5], &lob_pu);
 





More information about the icinga-checkins mailing list