summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f8cd589)
raw | patch | inline | side by side (parent: f8cd589)
author | Florian Forster <octo@noris.net> | |
Wed, 3 Mar 2010 13:01:30 +0000 (14:01 +0100) | ||
committer | Florian Forster <octo@noris.net> | |
Wed, 3 Mar 2010 13:01:30 +0000 (14:01 +0100) |
Apparently it returns success if it could fetch the parameter value and
doesn't interpret the value itself. So returning NULL when querying for
OCI_ATTR_SERVER_STATUS does not result in an error. Handle this as a
lost connection.
Thanks to Sven for pointing this out :)
doesn't interpret the value itself. So returning NULL when querying for
OCI_ATTR_SERVER_STATUS does not result in an error. Handle this as a
lost connection.
Thanks to Sven for pointing this out :)
src/oracle.c | patch | blob | history |
diff --git a/src/oracle.c b/src/oracle.c
index 49cf657123b303c4dc292f55dff63a37b02e0dff..7a8ccc6bf5b7ae3479743a86d945086b086fb9d0 100644 (file)
--- a/src/oracle.c
+++ b/src/oracle.c
o_report_error ("o_read_database", "OCIAttrGet", oci_error);
return (-1);
}
- assert (server_handle != NULL);
- connection_status = 0;
- status = OCIAttrGet ((void *) server_handle, OCI_HTYPE_SERVER,
- (void *) &connection_status, /* size pointer = */ NULL,
- OCI_ATTR_SERVER_STATUS, oci_error);
- if (status != OCI_SUCCESS)
+ if (server_handle == NULL)
{
- o_report_error ("o_read_database", "OCIAttrGet", oci_error);
- return (-1);
+ connection_status = OCI_SERVER_NOT_CONNECTED;
+ }
+ else /* if (server_handle != NULL) */
+ {
+ connection_status = 0;
+ status = OCIAttrGet ((void *) server_handle, OCI_HTYPE_SERVER,
+ (void *) &connection_status, /* size pointer = */ NULL,
+ OCI_ATTR_SERVER_STATUS, oci_error);
+ if (status != OCI_SUCCESS)
+ {
+ o_report_error ("o_read_database", "OCIAttrGet", oci_error);
+ return (-1);
+ }
}
if (connection_status != OCI_SERVER_NORMAL)