--- sql/oracle/parser3oracle.C 2002/10/31 10:13:57 1.22 +++ sql/oracle/parser3oracle.C 2002/12/09 11:07:52 1.25 @@ -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.22 2002/10/31 10:13:57 paf Exp $"; +static const char *RCSId="$Id: parser3oracle.C,v 1.25 2002/12/09 11:07:52 paf Exp $"; #include "config_includes.h" @@ -68,18 +68,17 @@ static int pa_setenv(const char *name, c #else //#ifdef HAVE_SETENV if(value) { - char *buf; if(prev_value) { // MEM_LEAK_HERE - buf=(char *)::malloc(strlen(prev_value) + char *buf=(char *)::malloc(strlen(prev_value) +strlen(value) +1); strcpy(buf, prev_value); strcat(buf, value); - } else - buf=value; + value=buf; + } - return setenv(name, buf, 1/*overwrite*/); + return setenv(name, value, 1/*overwrite*/); } else { unsetenv(name); return 0; @@ -388,6 +387,7 @@ public: OCIStmt *stmthp=0; bool failed=false; + SQL_Exception sql_exception; if(setjmp(cs.mark)) { failed=true; goto cleanup; @@ -423,9 +423,15 @@ public: } } - execute_prepared(services, cs, - statement, stmthp, lobs, - offset, limit, handlers); + try { + execute_prepared(services, cs, + statement, stmthp, lobs, + offset, limit, handlers); + } catch(const SQL_Exception& e) { + sql_exception=e; + } catch(...) { + sql_exception=SQL_Exception("exception occured in SQL_Driver_query_event_handlers"); // out of memory... + } } cleanup: // no check call after this point! { @@ -445,6 +451,8 @@ cleanup: // no check call after this poi if(failed) services._throw(cs.error); + if(sql_exception.defined()) + services._throw(sql_exception); } private: // private funcs