pgpool2.git / summary / log / commit / refs

commit    b925dd1444f4d04cb1aaa9e9aac05c8a9e5e4732
Author:   Tatsuo Ishii <ishii at sraoss.co.jp>
Date:     Wed Feb 23 06:45:44 2011 +0000

    Add error message to send_simplequery_message().
    Enhance do_query() so that it emmits an error message when receiving ERROR
    from backend.


pool_process_query.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pool_process_query.c b/pool_process_query.c index a53e99e3b..eec254c55 100644 --- a/pool_process_query.c +++ b/pool_process_query.c @@ -781,7 +781,7 @@ POOL_STATUS pool_parallel_exec(POOL_CONNECTION *frontend, /* - * send SimpleQuery message to a node. + * send simple query message to a node. */ POOL_STATUS send_simplequery_message(POOL_CONNECTION *backend, int len, char *string, int major) { @@ -796,6 +796,7 @@ POOL_STATUS send_simplequery_message(POOL_CONNECTION *backend, int len, char *st if (pool_write_and_flush(backend, string, len) < 0) { + pool_error("send_simplequery_message: failed to send query: %s", string); return POOL_END; } @@ -2355,6 +2356,16 @@ POOL_STATUS do_query(POOL_CONNECTION *backend, char *query, POOL_SELECT_RESULT * pool_debug("do_query: kind: %c", kind); + if (kind == 'E') + { + char *message; + + if (pool_extract_error_message(false, backend, major, true, &message)) + { + pool_log("do_query: error message from backend %s", message); + } + } + if (major == PROTO_MAJOR_V3) { if (pool_read(backend, &len, sizeof(len)) < 0) [parent: 689415466136]