--- sql/oracle/parser3oracle.C 2004/06/18 15:55:52 1.60 +++ sql/oracle/parser3oracle.C 2007/02/13 10:38:09 1.68 @@ -7,7 +7,8 @@ 2001.07.30 using Oracle 8.1.6 [@test tested with Oracle 7.x.x] */ -static const char *RCSId="$Id: parser3oracle.C,v 1.60 2004/06/18 15:55:52 paf Exp $"; + +static const char *RCSId="$Id: parser3oracle.C,v 1.68 2007/02/13 10:38:09 misha Exp $"; #include "config_includes.h" @@ -19,6 +20,7 @@ static const char *RCSId="$Id: parser3or #define MAX_IN_LOBS 5 #define MAX_LOB_NAME_LENGTH 100 #define MAX_OUT_STRING_LENGTH 4000 +#define MAX_BINDS 100 #define EMPTY_CLOB_FUNC_CALL "empty_clob()" @@ -44,6 +46,8 @@ inline int min(int a, int b){ return a(aconnection); const char* cstrClientCharset=connection.options.cstrClientCharset; Query_lobs lobs={{0}, 0}; @@ -445,6 +462,9 @@ public: failed=true; goto cleanup; } else { + if(placeholders_count>MAX_BINDS) + fail(connection, "too many bind variables"); + const char *statement=preprocess_statement(connection, astatement, lobs); check(connection, "HandleAlloc STMT", OCIHandleAlloc( @@ -460,13 +480,17 @@ public: }; int binds_size=sizeof(Bind_info) * placeholders_count; + // we DO store OCIBind* into ATOMIC gc memory, + // but we do not allocate/free it, that's done automatically from oracle [using environment handles] + // so we don't have to bother with that Bind_info* binds=static_cast(services.malloc_atomic(binds_size)); { for(size_t i=0; i