From: <ibr...@us...> - 2011-04-15 15:04:27
|
Revision: 3942 http://tora.svn.sourceforge.net/tora/?rev=3942&view=rev Author: ibre5041 Date: 2011-04-15 15:04:21 +0000 (Fri, 15 Apr 2011) Log Message: ----------- Fixes for compilation on MSVC Express 2010 Fix SEGFAULT. Statement of type OTHER "EXPLAIN PLAN FOR SELECT * FROM DUAL WHERE DUMMY = :X" in fact has NO bind variables. Modified Paths: -------------- branches/tora-trotl/src/trotl/src/trotl_stat.cpp Modified: branches/tora-trotl/src/trotl/src/trotl_stat.cpp =================================================================== --- branches/tora-trotl/src/trotl/src/trotl_stat.cpp 2011-04-15 14:21:41 UTC (rev 3941) +++ branches/tora-trotl/src/trotl/src/trotl_stat.cpp 2011-04-15 15:04:21 UTC (rev 3942) @@ -103,27 +103,31 @@ _out_binds = new unsigned [get_bindpar_count()+1]; } - int ipos=1; - for(std::vector<BindVarDecl>::iterator it = parser._bindvars.begin(); it != parser._bindvars.end(); ++it, ++ipos) + if( get_stmt_type() != STMT_OTHER && get_stmt_type() != STMT_DROP && get_stmt_type() != STMT_CREATE && + get_stmt_type() != STMT_ALTER && get_stmt_type() != OCI_STMT_UNKNOWN) { - if(it->inout == "in") + int ipos=1; + for(std::vector<BindVarDecl>::iterator it = parser._bindvars.begin(); it != parser._bindvars.end(); ++it, ++ipos) { - _in_binds[++_in_pos] = ipos; - } else if(it->inout == "inout") { - _in_binds[++_in_pos] = ipos; - _out_binds[++_out_pos] = ipos; - } else if(it->inout == "out") { - _out_binds[++_out_pos] = ipos; - } else { - throw OciException(__TROTL_HERE__, "Unsupported bindpar parameter: %s\n").arg(it->inout); - }; + if(it->inout == "in") + { + _in_binds[++_in_pos] = ipos; + } else if(it->inout == "inout") { + _in_binds[++_in_pos] = ipos; + _out_binds[++_out_pos] = ipos; + } else if(it->inout == "out") { + _out_binds[++_out_pos] = ipos; + } else { + throw OciException(__TROTL_HERE__, "Unsupported bindpar parameter: %s\n").arg(it->inout); + }; - //Create BindPar instance, constructor takes two arguments (position, BindVarDecl&) - _all_binds[ipos] = BindParFactTwoParmSing::Instance().create(it->bindtype, ipos, *this, *it); + //Create BindPar instance, constructor takes two arguments (position, BindVarDecl&) + _all_binds[ipos] = BindParFactTwoParmSing::Instance().create(it->bindtype, ipos, *this, *it); - if ( _all_binds[ipos].get() == NULL ) - throw OciException(__TROTL_HERE__, "BindPar: Data type not registered: %s\n").arg(it->bindtype); + if ( _all_binds[ipos].get() == NULL ) + throw OciException(__TROTL_HERE__, "BindPar: Data type not registered: %s\n").arg(it->bindtype); + } } _in_cnt = _in_pos; _in_pos=0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |