pgpool2.git / summary / log / commit / refs

commit    556f981e2fef0899446ba71a757875e2c5124740
Author:   Toshihiro Kitagawa <kitagawa at sraoss.co.jp>
Date:     Wed Jun 30 00:12:11 2010 +0000

    Add extended query protocol support to pool_send_and_wait().


pool_query_context.c | 13 ++++++++++--- pool_query_context.h | 4 +--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pool_query_context.c b/pool_query_context.c index 8e9094757..8bd444cc7 100644 --- a/pool_query_context.c +++ b/pool_query_context.c @@ -392,9 +392,10 @@ void pool_where_to_send(POOL_QUERY_CONTEXT *query_context, char *query, Node *no * -1: do not send this node_id * 0: send to all nodes * >0: send to this node_id + * kind: simple query protocol is "" */ POOL_STATUS pool_send_and_wait(POOL_QUERY_CONTEXT *query_context, char *query, int len, - int send_type, int node_id) + int send_type, int node_id, char *kind) { POOL_SESSION_CONTEXT *session_context; POOL_CONNECTION *frontend; @@ -418,9 +419,15 @@ POOL_STATUS pool_send_and_wait(POOL_QUERY_CONTEXT *query_context, char *query, i per_node_statement_log(backend, i, query); - if (send_simplequery_message(CONNECTION(backend, i), len, query, MAJOR(backend)) != POOL_CONTINUE) + if (*kind == '\0') { - return POOL_END; + if (send_simplequery_message(CONNECTION(backend, i), len, query, MAJOR(backend)) != POOL_CONTINUE) + return POOL_END; + } + else + { + if (send_extended_protocol_message(backend, i, kind, len, query) != POOL_CONTINUE) + return POOL_END; } } diff --git a/pool_query_context.h b/pool_query_context.h index 18d7d8a2e..f81336875 100644 --- a/pool_query_context.h +++ b/pool_query_context.h @@ -47,8 +47,6 @@ typedef struct { /* below are extended query only */ bool is_named_statement; /* true if named statement */ bool is_named_portal; /* true if named portal */ - /* pointer to unnamed statement or named statement */ - /* pointer to unnamed portal or named portal */ /* query state: either 0: before parse, 1: parse done, 2: bind * done, 3: describe done 4: execute done -1: in error -> or * should be a bitmap? */ @@ -68,6 +66,6 @@ extern void pool_clear_node_to_be_sent(POOL_QUERY_CONTEXT *query_context); extern void pool_setall_node_to_be_sent(POOL_QUERY_CONTEXT *query_context); extern void pool_where_to_send(POOL_QUERY_CONTEXT *query_context, char *query, Node *node); POOL_STATUS pool_send_and_wait(POOL_QUERY_CONTEXT *query_context, char *query, int len, - int send_type, int node_id); + int send_type, int node_id, char *kind); #endif /* POOL_QUERY_CONTEXT_H */ [parent: 367b433ced6b]