Diff for /parser3/src/classes/table.C between versions 1.145 and 1.146

version 1.145, 2002/03/15 10:08:13 version 1.146, 2002/03/27 15:30:34
Line 140  static void _load(Request& r, const Stri Line 140  static void _load(Request& r, const Stri
         static_cast<VTable *>(r.self)->set_table(table);          static_cast<VTable *>(r.self)->set_table(table);
 }  }
   
 /// @todo "z\nz" "zzz""zz"  /// @todo "x\nx" "xxx""xx"
 static void _save(Request& r, const String& method_name, MethodParams *params) {  static void _save(Request& r, const String& method_name, MethodParams *params) {
         Pool& pool=r.pool();          Pool& pool=r.pool();
         Value& vfile_name=params->as_no_junction(params->size()-1,           Value& vfile_name=params->as_no_junction(params->size()-1, 
Line 178  static void _save(Request& r, const Stri Line 178  static void _save(Request& r, const Stri
                 else if(mode=="nameless")                  else if(mode=="nameless")
                         /*ok, already skipped names output*/;                          /*ok, already skipped names output*/;
                 else                  else
                         throw Exception(0, 0,                          throw Exception("parser.runtime",
                                 &mode,                                  &mode,
                                 "unknown mode, must be 'append'");                                  "unknown mode, must be 'append'");
   
Line 227  static void _offset(Request& r, const St Line 227  static void _offset(Request& r, const St
                     else if(whence=="set")                      else if(whence=="set")
                                 absolute=true;                                  absolute=true;
                     else                      else
                                 throw Exception(0, 0,                                  throw Exception("parser.runtime",
                                         &whence,                                          &whence,
                                         "is invalid whence, valid are 'cur' or 'set'");                                          "is invalid whence, valid are 'cur' or 'set'");
                 }                                     }                   
Line 315  static void _hash(Request& r, const Stri Line 315  static void _hash(Request& r, const Stri
                                                 value_fields+=self_table.column_name2index(value_field_name, true);                                                  value_fields+=self_table.column_name2index(value_field_name, true);
                                         }                                          }
                                 } else                                  } else
                                         throw Exception(0, 0,                                          throw Exception("parser.runtime",
                                                 &method_name,                                                  &method_name,
                                                 "value field(s) must be string or self_table"                                                  "value field(s) must be string or self_table"
                                         );                                          );
Line 404  static void _sort(Request& r, const Stri Line 404  static void _sort(Request& r, const Stri
   
 static bool _locate_expression(Request& r, const String& method_name, MethodParams *params) {  static bool _locate_expression(Request& r, const String& method_name, MethodParams *params) {
         if(params->size()>1)          if(params->size()>1)
                 throw Exception(0, 0,                   throw Exception("parser.runtime", 
                         &method_name,                          &method_name,
                         "locate by expression has only one parameter - expression");                          "locate by expression has only one parameter - expression");
   
Line 425  static bool _locate_expression(Request& Line 425  static bool _locate_expression(Request&
 }  }
 static bool _locate_name_value(Request& r, const String& method_name, MethodParams *params) {  static bool _locate_name_value(Request& r, const String& method_name, MethodParams *params) {
         if(params->size()>2)          if(params->size()>2)
                 throw Exception(0, 0,                   throw Exception("parser.runtime", 
                         &method_name,                          &method_name,
                         "locate by name and value has only two parameters - name and value");                          "locate by name and value has only two parameters - name and value");
   
Line 486  static void _join(Request& r, const Stri Line 486  static void _join(Request& r, const Stri
   
         Table *maybe_src=params->as_no_junction(0, "table ref must not be code").get_table();          Table *maybe_src=params->as_no_junction(0, "table ref must not be code").get_table();
         if(!maybe_src)          if(!maybe_src)
                 throw Exception(0, 0,                   throw Exception("parser.runtime", 
                         &method_name,                           &method_name, 
                         "source is not a table");                          "source is not a table");
   
         Table& src=*maybe_src;          Table& src=*maybe_src;
         Table& dest=static_cast<VTable *>(r.self)->table();          Table& dest=static_cast<VTable *>(r.self)->table();
         if(&src == &dest)          if(&src == &dest)
                 throw Exception(0, 0,                   throw Exception("parser.runtime", 
                         &method_name,                           &method_name, 
                         "source and destination are same table");                          "source and destination are same table");
   
Line 578  static void _sql(Request& r, const Strin Line 578  static void _sql(Request& r, const Strin
                                 if(Value *voffset=(Value *)options->get(*sql_offset_name))                                  if(Value *voffset=(Value *)options->get(*sql_offset_name))
                                         offset=(ulong)r.process(*voffset).as_double();                                          offset=(ulong)r.process(*voffset).as_double();
                         } else                          } else
                                 throw Exception(0, 0,                                  throw Exception("parser.runtime",
                                         &method_name,                                          &method_name,
                                         "options must be hash");                                          "options must be hash");
         }          }
Line 611  static void _sql(Request& r, const Strin Line 611  static void _sql(Request& r, const Strin
 #endif                            #endif                          
         } catch(const Exception& e) { // query problem          } catch(const Exception& e) { // query problem
                 // more specific source [were url]                  // more specific source [were url]
                 throw Exception(e.type(), e.code(),                   throw Exception("sql.execute", 
                         &statement_string,                           &statement_string, 
                         "%s", e.comment());                          "%s", e.comment());
         }          }

Removed from v.1.145  
changed lines
  Added in v.1.146


E-mail: