|
|
| version 1.11, 2001/10/08 16:42:06 | version 1.12, 2001/10/19 12:43:30 |
|---|---|
| Line 52 public: | Line 52 public: |
| void add_column(void *ptr, size_t size) { /* ignore */ } | void add_column(void *ptr, size_t size) { /* ignore */ } |
| void before_rows() { | void before_rows() { |
| // there are some result rows, which is wrong | // there are some result rows, which is wrong |
| PTHROW(0, 0, | throw Exception(0, 0, |
| &statement_string, | &statement_string, |
| "must return nothing"); | "must return nothing"); |
| } | } |
| Line 68 static void _sql(Request& r, const Strin | Line 68 static void _sql(Request& r, const Strin |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| if(!r.connection) | if(!r.connection) |
| PTHROW(0, 0, | throw Exception(0, 0, |
| &method_name, | &method_name, |
| "without connect"); | "without connect"); |
| Line 79 static void _sql(Request& r, const Strin | Line 79 static void _sql(Request& r, const Strin |
| const char *statement_cstr= | const char *statement_cstr= |
| statement_string.cstr(String::UL_UNSPECIFIED, r.connection); | statement_string.cstr(String::UL_UNSPECIFIED, r.connection); |
| Void_sql_event_handlers handlers(pool, statement_string); | Void_sql_event_handlers handlers(pool, statement_string); |
| bool need_rethrow=false; Exception rethrow_me; | try { |
| PTRY { | |
| r.connection->query( | r.connection->query( |
| statement_cstr, 0, 0, | statement_cstr, 0, 0, |
| handlers); | handlers); |
| } catch(const Exception& e) { | |
| // more specific source [were url] | |
| throw Exception(e.type(), e.code(), | |
| &statement_string, | |
| "%s", e.comment()); | |
| } | } |
| PCATCH(e) { | |
| rethrow_me=e; need_rethrow=true; | |
| } | |
| PEND_CATCH | |
| if(need_rethrow) | |
| PTHROW(rethrow_me.type(), rethrow_me.code(), | |
| &statement_string, // setting more specific source [were url] | |
| rethrow_me.comment()); | |
| } | } |
| // constructor | // constructor |