Diff for /parser3/src/classes/table.C between versions 1.207 and 1.212

version 1.207, 2004/12/23 14:51:31 version 1.212, 2005/08/26 12:01:38
Line 1 Line 1
 /** @file  /** @file
         Parser: @b table parser class.          Parser: @b table parser class.
   
         Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com)          Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com)
         Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)          Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
 */  */
   
Line 21  static const char * const IDENT_TABLE_C= Line 21  static const char * const IDENT_TABLE_C=
   
 class MTable: public Methoded {  class MTable: public Methoded {
 public: // VStateless_class  public: // VStateless_class
         Value* create_new_value(Pool&) { return new VTable(); }          Value* create_new_value(Pool&, HashStringValue&) { return new VTable(); }
   
 public:  public:
         MTable();          MTable();
Line 73  static Table::Action_options get_action_ Line 73  static Table::Action_options get_action_
         ]          ]
         but there is ^table.locate[name;value]          but there is ^table.locate[name;value]
   
           ...if(voptions.is_defined() && !voptions.is_string()))
         if(maybe_options.is_string()) { // allow empty options          if(maybe_options.is_string()) { // allow empty options
                 result.defined=true;                  result.defined=true;
                 return result;                  return result;
Line 477  static void _offset(Request& r, MethodPa Line 478  static void _offset(Request& r, MethodPa
                                         "is invalid whence, valid are 'cur' or 'set'");                                          "is invalid whence, valid are 'cur' or 'set'");
                 }                  }
                                   
                 Value& offset_expr=params.as_junction(params.count()-1, "offset must be expression");                  int offset=params.as_int(params.count()-1, "offset must be expression", r);
                 table.offset(absolute, r.process_to_value(offset_expr).as_int());                  table.offset(absolute, offset);
         } else          } else
                 r.write_no_lang(*new VInt(table.current()));                  r.write_no_lang(*new VInt(table.current()));
 }  }
Line 939  static void _sql(Request& r, MethodParam Line 940  static void _sql(Request& r, MethodParam
         ulong offset=0;          ulong offset=0;
         if(params.count()>1) {          if(params.count()>1) {
                 Value& voptions=params.as_no_junction(1, "options must be hash, not code");                  Value& voptions=params.as_no_junction(1, "options must be hash, not code");
                 if(!voptions.is_string())                  if(voptions.is_defined() && !voptions.is_string())
                         if(HashStringValue* options=voptions.get_hash()) {                          if(HashStringValue* options=voptions.get_hash()) {
                                 int valid_options=0;                                  int valid_options=0;
                                 if(Value* vbind=options->get(sql_bind_name)) {                                  if(Value* vbind=options->get(sql_bind_name)) {
Line 981  static void _sql(Request& r, MethodParam Line 982  static void _sql(Request& r, MethodParam
 #endif    #endif  
         r.connection()->query(          r.connection()->query(
                 statement_cstr,                   statement_cstr, 
                 0, 0,                  placeholders_count, placeholders,
                 offset, limit,                   offset, limit, 
                 handlers,                  handlers,
                 statement_string);                  statement_string);

Removed from v.1.207  
changed lines
  Added in v.1.212


E-mail: