* -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;
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;
}
}
/* 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? */
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 */