--- sql/oracle/parser3oracle.C 2003/12/23 11:52:37 1.44 +++ sql/oracle/parser3oracle.C 2003/12/24 12:03:32 1.46 @@ -7,7 +7,7 @@ 2001.07.30 using Oracle 8.1.6 [@test tested with Oracle 7.x.x] */ -static const char *RCSId="$Id: parser3oracle.C,v 1.44 2003/12/23 11:52:37 paf Exp $"; +static const char *RCSId="$Id: parser3oracle.C,v 1.46 2003/12/24 12:03:32 paf Exp $"; #include "config_includes.h" @@ -38,6 +38,12 @@ inline int max(int a, int b) { return a> inline int min(int a, int b){ return aOCIErrorGet((dvoid *)cs.errhp, (ub4)1, (text *)NULL, &errcode, - (text *)reason, (ub4)sizeof(reason), OCI_HTYPE_ERROR)==OCI_SUCCESS) - msg=reason; - - // transcode to $request:charset from connect-string?client_charset - if(const char* cstrClientCharset=cs.options.cstrClientCharset) - if(msg) { - if(size_t msg_length=strlen(msg)) { - cs.services->transcode(msg, msg_length, - msg, msg_length, - cstrClientCharset, - cs.services->request_charset()); + sb4 errcode; + if(OracleSQL_driver->OCIErrorGet((dvoid *)cs.errhp, (ub4)1, (text *)NULL, &errcode, + (text *)reason, (ub4)sizeof(reason), OCI_HTYPE_ERROR)==OCI_SUCCESS) { + msg=reason; + + // transcode to $request:charset from connect-string?client_charset + if(const char* cstrClientCharset=cs.options.cstrClientCharset) { + if(msg) { + if(size_t msg_length=strlen(msg)) { + cs.services->transcode(msg, msg_length, + msg, msg_length, + cstrClientCharset, + cs.services->request_charset()); + } } } - else - msg="[can not get error description]"; - break; + } else + msg="[can not get error description]"; + break; } case OCI_NEED_DATA: msg="NEED_DATA"; break; @@ -1034,9 +1046,9 @@ void check(OracleSQL_connection_struct & /* Intbind callback that does not do any data input. */ /* ----------------------------------------------------------------- */ static sb4 cbf_no_data( - dvoid *ctxp, - OCIBind *bindp, - ub4 iter, ub4 index, + dvoid* /*ctxp*/, + OCIBind* /*bindp*/, + ub4 /*iter*/, ub4 /*index*/, dvoid **bufpp, ub4 *alenpp, ub1 *piecep, @@ -1055,7 +1067,7 @@ static sb4 cbf_no_data( /* ----------------------------------------------------------------- */ static sb4 cbf_get_data(dvoid *ctxp, OCIBind *bindp, - ub4 iter, ub4 index, + ub4 /*iter*/, ub4 index, dvoid **bufpp, ub4 **alenp, ub1 *piecep, @@ -1093,11 +1105,11 @@ static sb4 cbf_get_data(dvoid *ctxp, void tolower(char *out, const char *in, size_t size) { while(size--) - *out++=tolower(*in++); + *out++=(char)tolower(*in++); } void toupper(char *out, const char *in, size_t size) { while(size--) - *out++=toupper(*in++); + *out++=(char)toupper(*in++); }