|
|
| version 1.206, 2013/03/09 21:55:21 | version 1.208, 2013/08/22 15:57:01 |
|---|---|
| Line 120 static void _bool(Request& r, MethodPara | Line 120 static void _bool(Request& r, MethodPara |
| converted=params.as_bool(0, "default must be bool", r); // (default) | converted=params.as_bool(0, "default must be bool", r); // (default) |
| else | else |
| throw Exception(PARSER_RUNTIME, 0, "unable to convert empty string without default specified"); | throw Exception(PARSER_RUNTIME, 0, "unable to convert empty string without default specified"); |
| } else if( (str[0]=='T' || str[0]=='t') && (str[1]=='R' || str[1]=='r') && (str[2]=='U' || str[2]=='u') and | } else if( (str[0]=='T' || str[0]=='t') && (str[1]=='R' || str[1]=='r') && (str[2]=='U' || str[2]=='u') && |
| (str[3]=='E' || str[3]=='e') && str[4]==0 ) { // "true" | (str[3]=='E' || str[3]=='e') && str[4]==0 ) { // "true" |
| converted=true; | converted=true; |
| } else if( (str[0]=='F' || str[0]=='f') && (str[1]=='A' || str[1]=='a') && (str[2]=='L' || str[2]=='l') and | } else if( (str[0]=='F' || str[0]=='f') && (str[1]=='A' || str[1]=='a') && (str[2]=='L' || str[2]=='l') && |
| (str[3]=='S' || str[3]=='s') && (str[4]=='E' || str[4]=='e') && str[5]==0 ) { // "false" | (str[3]=='S' || str[3]=='s') && (str[4]=='E' || str[4]=='e') && str[5]==0 ) { // "false" |
| converted=false; | converted=false; |
| } else { | } else { |
| Line 486 class String_sql_event_handlers: public | Line 486 class String_sql_event_handlers: public |
| bool got_column; | bool got_column; |
| public: | public: |
| bool got_cell; | bool got_cell; |
| String& result; | const String* result; |
| public: | public: |
| String_sql_event_handlers( | String_sql_event_handlers( |
| const String& astatement_string, const char* astatement_cstr): | const String& astatement_string, const char* astatement_cstr): |
| statement_string(astatement_string), statement_cstr(astatement_cstr), | statement_string(astatement_string), statement_cstr(astatement_cstr), |
| got_column(false), | got_column(false), |
| got_cell(false), | got_cell(false), |
| result(*new String) {} | result(&String::Empty) {} |
| bool add_column(SQL_Error& error, const char* /*str*/, size_t /*length*/) { | bool add_column(SQL_Error& error, const char* /*str*/, size_t /*length*/) { |
| if(got_column) { | if(got_column) { |
| Line 517 public: | Line 517 public: |
| try { | try { |
| got_cell=true; | got_cell=true; |
| result.append_know_length(str, length, String::L_TAINTED); | result=new String(str, String::L_TAINTED /* no length as 0x00 can be inside */ ); |
| return false; | return false; |
| } catch(...) { | } catch(...) { |
| error=SQL_Error("exception occured in String_sql_event_handlers::add_row_cell"); | error=SQL_Error("exception occured in String_sql_event_handlers::add_row_cell"); |
| Line 587 const String* sql_result_string(Request& | Line 587 const String* sql_result_string(Request& |
| if(!handlers.got_cell) | if(!handlers.got_cell) |
| return 0; // no lines, caller should return second param[default value] | return 0; // no lines, caller should return second param[default value] |
| return &handlers.result; | return handlers.result; |
| } | } |
| static void _sql(Request& r, MethodParams& params) { | static void _sql(Request& r, MethodParams& params) { |