pgpool2.git / summary / log / commit / refs

commit    ee2e55baad1b3ac87087181b1a3b41ec73c06d0b
Author:   Toshihiro Kitagawa <kitagawa at sraoss.co.jp>
Date:     Mon Aug 29 07:09:50 2011 +0000

    Change the handling of sequence functions(nextval, setval) so that they
    completely obey setting of black/white_function_list.
    They were always handled as write functions before. The checking whether
    it is a sequence function was verbosity.


pool_process_query.c | 2 ++ pool_proto_modules.h | 1 - pool_query_context.c | 8 +------- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/pool_process_query.c b/pool_process_query.c index 29f8ada5b..808e943e8 100644 --- a/pool_process_query.c +++ b/pool_process_query.c @@ -1514,6 +1514,7 @@ int is_select_query(Node *node, char *sql) return 0; } +#ifdef NOT_USED /* * returns true if SQL is SELECT statement including nextval() or * setval() call @@ -1553,6 +1554,7 @@ bool is_sequence_query(Node *node) return false; } +#endif /* * Returns true if SQL is transaction commit or rollback command (COMMIT, diff --git a/pool_proto_modules.h b/pool_proto_modules.h index d3690a179..c5b691575 100644 --- a/pool_proto_modules.h +++ b/pool_proto_modules.h @@ -151,7 +151,6 @@ extern int RowDescription(POOL_CONNECTION *frontend, extern POOL_STATUS wait_for_query_response(POOL_CONNECTION *frontend, POOL_CONNECTION *backend, int protoVersion); extern int is_select_query(Node *node, char *sql); -extern bool is_sequence_query(Node *node); extern bool is_commit_query(Node *node); extern bool is_rollback_query(Node *node); extern bool is_commit_or_rollback_query(Node *node); diff --git a/pool_query_context.c b/pool_query_context.c index e6deb9601..031215aeb 100644 --- a/pool_query_context.c +++ b/pool_query_context.c @@ -447,7 +447,7 @@ void pool_where_to_send(POOL_QUERY_CONTEXT *query_context, char *query, Node *no } else if (REPLICATION || PARALLEL_MODE) { - if (is_select_query(node, query) && !is_sequence_query(node)) + if (is_select_query(node, query)) { /* * If a writing function call is used or replicate_select is true, @@ -1013,12 +1013,6 @@ static POOL_DEST send_to_where(Node *node, char *query) /* SELECT INTO or SELECT FOR SHARE or UPDATE ? */ if (pool_has_insertinto_or_locking_clause(node)) return POOL_PRIMARY; - /* - * SELECT nextval(), setval() - * XXX: We do not search in subquery. - */ - else if (is_sequence_query(node)) - return POOL_PRIMARY; return POOL_EITHER; } [parent: d02ea23900ac]