--- parser3/src/classes/op.C 2001/05/21 16:01:10 1.22 +++ parser3/src/classes/op.C 2001/05/21 17:17:11 1.23 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: op.C,v 1.22 2001/05/21 16:01:10 parser Exp $ + $Id: op.C,v 1.23 2001/05/21 17:17:11 parser Exp $ */ #include "classes.h" @@ -309,45 +309,6 @@ static void _connect(Request& r, const S rethrow_me.comment()); } -static void _sql(Request& r, const String& method_name, MethodParams *params) { - Pool& pool=r.pool(); - - if(!r.connection) - PTHROW(0, 0, - &method_name, - "without connect"); - - Value& statement=params->get_junction(0, "statement must be code"); - - Temp_lang temp_lang(r, String::UL_SQL); - const String& statement_string=r.process(statement).as_string(); - const char *statement_cstr= - statement_string.cstr(String::UL_UNSPECIFIED, r.connection); - unsigned int sql_column_count; SQL_Driver::Cell *sql_columns; - unsigned long sql_row_count; SQL_Driver::Cell **sql_rows; - bool need_rethrow=false; Exception rethrow_me; - PTRY { - r.connection->query( - statement_cstr, 0, 0, - &sql_column_count, &sql_columns, - &sql_row_count, &sql_rows); - } - PCATCH(e) { // connect/process problem - rethrow_me=e; need_rethrow=true; - } - PEND_CATCH - if(need_rethrow) - PTHROW(rethrow_me.type(), rethrow_me.code(), - &statement_string, // setting more specific source [were url] - rethrow_me.comment()); - - // there are some result rows, which is wrong - if(sql_row_count) - PTHROW(0, 0, - &statement_string, - "must not return result"); -} - // constructor MOP::MOP(Pool& apool) : Methoded(apool), @@ -409,8 +370,6 @@ MOP::MOP(Pool& apool) : Methoded(apool), // ^connect[protocol://user:pass@host[:port]/database]{code with ^sql-s} add_native_method("connect", Method::CT_ANY, _connect, 2, 2); - // ^sql[query] - add_native_method("sql", Method::CT_ANY, _sql, 1, 1); } // constructor & configurator