From: Markus H. <mar...@mh...> - 2007-11-06 08:41:03
|
Hi, I'll be happy to apply any patch that adds the missing error checks. =20 Unfortunately I won't be able to verify that it works as I don't have =20 access to Oracle. I'd appreciate if anyone else with an Oracle =20 installation could test-drive the patches, just to make sure. Let me know when you have a working patch. regards, Markus Quoting Balazs Scheidler <ba...@ba...>: > hi, > > We've run accross the need to use the oracle driver from libdbi, but it > has not error checking at all. > > I'm still testing the following patch, would it be possible to merge > something like this if it turns out to be working ok? > > diff --git a/drivers/oracle/dbd_oracle.c b/drivers/oracle/dbd_oracle.c > index 2796cd6..a38c32b 100755 > --- a/drivers/oracle/dbd_oracle.c > +++ b/drivers/oracle/dbd_oracle.c > @@ -290,17 +290,22 @@ dbi_result_t *dbd_query_null(dbi_conn_t *conn, =20 > const char unsigned *statement, s > > if( OCIStmtPrepare(stmt, Oconn->err, (char *) statement, > (ub4) st_length, (ub4) OCI_NTV_SYNTAX, =20 > (ub4) OCI_DEFAULT)) { > + OCIHandleFree(stmt, OCI_HTYPE_STMT); > return NULL; > } > > OCIAttrGet(stmt, OCI_HTYPE_STMT, (dvoid *) &stmttype, > (ub4 *) 0, (ub4) OCI_ATTR_STMT_TYPE, Oconn->err); > > - OCIStmtExecute(Oconn->svc, stmt, Oconn->err, > + status =3D OCIStmtExecute(Oconn->svc, stmt, Oconn->err, > (ub4) (stmttype =3D=3D OCI_STMT_SELECT ? 0 : 1), > (ub4) 0, (CONST OCISnapshot *) NULL, =20 > (OCISnapshot *) NULL, > MY_OCI_STMT_SCROLLABLE_READONLY); > > + if( status !=3D OCI_SUCCESS) { > + OCIHandleFree(stmt, OCI_HTYPE_STMT); > + return NULL; > + } > > if( stmttype =3D=3D OCI_STMT_SELECT) { > > > > -- > Bazsi > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Libdbi-drivers-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel > --=20 Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |