|
|
| version 1.54, 2016/10/26 15:44:49 | version 1.57, 2019/09/11 15:26:09 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b VOID parser class. | Parser: @b VOID parser class. |
| Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) | Copyright (c) 2001-2017 Art. Lebedev Studio (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 14 | Line 14 |
| volatile const char * IDENT_VOID_C="$Id$"; | volatile const char * IDENT_VOID_C="$Id$"; |
| // externs | |
| extern String sql_bind_name; | |
| // class | // class |
| class MVoid: public Methoded { | class MVoid: public Methoded { |
| Line 31 public: | Line 27 public: |
| #ifndef DOXYGEN | #ifndef DOXYGEN |
| class Void_sql_event_handlers: public SQL_Driver_query_event_handlers { | class Void_sql_event_handlers: public SQL_Driver_query_event_handlers { |
| const String& statement_string; | |
| public: | public: |
| Void_sql_event_handlers(const String& astatement_string): statement_string(astatement_string) {} | |
| bool add_column(SQL_Error& /*error*/, const char* /*str*/, size_t /*length*/) { /* ignore */ return false; } | bool add_column(SQL_Error& /*error*/, const char* /*str*/, size_t /*length*/) { /* ignore */ return false; } |
| bool before_rows(SQL_Error& error) { | bool before_rows(SQL_Error& error) { |
| // there are some result rows, which is wrong | // there are some result rows, which is wrong |
| error=SQL_Error(PARSER_RUNTIME, | error=SQL_Error("must return nothing"); |
| /*statement_string,*/ | |
| "must return nothing"); | |
| return true; | return true; |
| } | } |
| bool add_row(SQL_Error& /*error*/) { /* never */ return false; } | bool add_row(SQL_Error& /*error*/) { /* never */ return false; } |
| Line 74 static void _sql(Request& r, MethodParam | Line 66 static void _sql(Request& r, MethodParam |
| 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(String::L_SQL, r.connection()); | const char* statement_cstr=statement_string.untaint_cstr(String::L_SQL, r.connection()); |
| Void_sql_event_handlers handlers(statement_string); | Void_sql_event_handlers handlers; |
| r.connection()->query( | r.connection()->query(statement_cstr, placeholders_count, placeholders, 0, SQL_NO_LIMIT, handlers, statement_string); |
| statement_cstr, | |
| placeholders_count, placeholders, | |
| 0, SQL_NO_LIMIT, | |
| handlers, | |
| statement_string); | |
| if(bind) | if(bind) |
| unmarshal_bind_updates(*bind, placeholders_count, placeholders); | unmarshal_bind_updates(*bind, placeholders_count, placeholders); |