--- parser3/src/classes/void.C 2010/10/21 15:25:07 1.48 +++ parser3/src/classes/void.C 2012/03/16 09:24:08 1.50 @@ -1,12 +1,10 @@ /** @file Parser: @b VOID parser class. - Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_VOID_C="$Date: 2010/10/21 15:25:07 $"; - #include "classes.h" #include "pa_vmethod_frame.h" @@ -14,6 +12,8 @@ static const char * const IDENT_VOID_C=" #include "pa_vvoid.h" #include "pa_sql_connection.h" +volatile const char * IDENT_VOID_C="$Id: void.C,v 1.50 2012/03/16 09:24:08 moko Exp $"; + // externs extern String sql_bind_name; @@ -55,20 +55,16 @@ static void _sql(Request& r, MethodParam Value& statement=params.as_junction(0, "statement must be code"); HashStringValue* bind=0; - if(params.count()>1) { - Value& voptions=params.as_no_junction(1, "options must be hash, not code"); - if(voptions.is_defined() && !voptions.is_string()) - if(HashStringValue* options=voptions.get_hash()) { - int valid_options=0; - if(Value* vbind=options->get(sql_bind_name)) { - valid_options++; - bind=vbind->get_hash(); - } - if(valid_options!=options->count()) - throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); - } else - throw Exception(PARSER_RUNTIME, 0, OPTIONS_MUST_BE_HASH); - } + if(params.count()>1) + if(HashStringValue* options=params.as_hash(1)) { + int valid_options=0; + if(Value* vbind=options->get(sql_bind_name)) { + valid_options++; + bind=vbind->get_hash(); + } + if(valid_options!=options->count()) + throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); + } SQL_Driver::Placeholder* placeholders=0; uint placeholders_count=0;