summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 52543e7)
raw | patch | inline | side by side (parent: 52543e7)
author | Florian Forster <octo@collectd.org> | |
Thu, 26 Jan 2012 10:36:03 +0000 (11:36 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 26 Jan 2012 10:36:03 +0000 (11:36 +0100) |
Change-Id: I9899b98517fe0c239bffcf7a75681560029aa2ba
src/oracle.c | patch | blob | history |
diff --git a/src/oracle.c b/src/oracle.c
index 1332da273a7db95427b0476131a0d37edbe23e0e..4c85e293f30d67922852283481789069fb0290ae 100644 (file)
--- a/src/oracle.c
+++ b/src/oracle.c
char buffer[2048];
sb4 error_code;
int status;
+ unsigned int record_number;
/* An operation may cause / return multiple errors. Loop until we have
- * handled all errors available. */
- while (42)
+ * handled all errors available (with a fail-save limit of 16). */
+ for (record_number = 1; record_number <= 16; record_number++)
{
memset (buffer, 0, sizeof (buffer));
error_code = -1;
- status = OCIErrorGet (eh, /* record number = */ 1,
+ status = OCIErrorGet (eh, (ub4) record_number,
/* sqlstate = */ NULL,
&error_code,
(text *) &buffer[0],
buffer[buffer_length] = 0;
}
- ERROR ("oracle plugin: %s: %s failed: %s",
- where, what, buffer);
+ ERROR ("oracle plugin: %s: %s failed: %s", where, what, buffer);
}
else
{
(OraText *) db->username, (ub4) strlen (db->username),
(OraText *) db->password, (ub4) strlen (db->password),
(OraText *) db->connect_id, (ub4) strlen (db->connect_id));
- if (status != OCI_SUCCESS)
+ if ((status != OCI_SUCCESS) && (status != OCI_SUCCESS_WITH_INFO))
{
o_report_error ("o_read_database", "OCILogon", oci_error);
DEBUG ("oracle plugin: OCILogon (%s): db->oci_service_context = %p;",
db->oci_service_context = NULL;
return (-1);
}
+ else if (status == OCI_SUCCESS_WITH_INFO)
+ {
+ /* TODO: Print NOTIFY message. */
+ }
assert (db->oci_service_context != NULL);
}