|
|
| version 1.335, 2016/10/04 13:23:46 | version 1.337, 2016/10/26 15:44:49 |
|---|---|
| Line 278 static void _create(Request& r, MethodPa | Line 278 static void _create(Request& r, MethodPa |
| } | } |
| // data | // data |
| Temp_lang temp_lang(r, String::L_PASS_APPENDED); | |
| StringSplitHelper sdata(r.process_to_string(params.as_junction(data_param_index, "body must be table or code"))); | StringSplitHelper sdata(r.process_to_string(params.as_junction(data_param_index, "body must be table or code"))); |
| char *data=sdata.base; | char *data=sdata.base; |
| Line 1217 inline Table::element_type row_from_stri | Line 1216 inline Table::element_type row_from_stri |
| if(!param.is_string() && !param.get_junction()) | if(!param.is_string() && !param.get_junction()) |
| throw Exception(PARSER_RUNTIME, 0, "row must be string, code or hash"); | throw Exception(PARSER_RUNTIME, 0, "row must be string, code or hash"); |
| Temp_lang temp_lang(r, String::L_PASS_APPENDED); | |
| const String& string=r.process_to_string(param); | const String& string=r.process_to_string(param); |
| // parse cells | // parse cells |
| Line 1407 static void _sql(Request& r, MethodParam | Line 1405 static void _sql(Request& r, MethodParam |
| if(bind) | if(bind) |
| placeholders_count=marshal_binds(*bind, placeholders); | placeholders_count=marshal_binds(*bind, placeholders); |
| Temp_lang temp_lang(r, String::L_SQL); | |
| const String& statement_string=r.process_to_string(statement); | const String& statement_string=r.process_to_string(statement); |
| const char* statement_cstr=statement_string.untaint_cstr(r.flang, r.connection()); | const char* statement_cstr=statement_string.untaint_cstr(String::L_SQL, r.connection()); |
| Table_sql_event_handlers handlers; | Table_sql_event_handlers handlers; |
| Line 1495 static void _select(Request& r, MethodPa | Line 1492 static void _select(Request& r, MethodPa |
| for(size_t row=size-1; result_table.count() < (size_t)limit; row--) { | for(size_t row=size-1; result_table.count() < (size_t)limit; row--) { |
| source_table.set_current(row); | source_table.set_current(row); |
| bool condition=r.process(vcondition, false/*don't intercept string*/).as_bool(); | bool condition=r.process(vcondition).as_bool(); |
| if(condition && ++appended > (size_t)offset) // ...condition is true, adding to the result | if(condition && ++appended > (size_t)offset) // ...condition is true, adding to the result |
| result_table+=source_table[row]; | result_table+=source_table[row]; |
| Line 1505 static void _select(Request& r, MethodPa | Line 1502 static void _select(Request& r, MethodPa |
| for(size_t row=0; row < size && result_table.count() < (size_t)limit; row++) { | for(size_t row=0; row < size && result_table.count() < (size_t)limit; row++) { |
| source_table.set_current(row); | source_table.set_current(row); |
| bool condition=r.process(vcondition, false/*don't intercept string*/).as_bool(); | bool condition=r.process(vcondition).as_bool(); |
| if(condition && ++appended > (size_t)offset) // ...condition is true, adding to the result | if(condition && ++appended > (size_t)offset) // ...condition is true, adding to the result |
| result_table+=source_table[row]; | result_table+=source_table[row]; |