pgpool2.git / summary / log / commit / refs
commit 3e8fb43ac5520ad6d86a84f53e6ce8ef3e3f522c
Author: Tatsuo Ishii <ishii at sraoss.co.jp>
Date: Thu Jul 22 05:50:03 2010 +0000
Fix SimpleQuery. If query is rewritten by timestamp, query string and
its length was not consistent.
pool_proto_modules.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/pool_proto_modules.c b/pool_proto_modules.c
index 893b5558d..a7b343d36 100644
--- a/pool_proto_modules.c
+++ b/pool_proto_modules.c
@@ -115,6 +115,7 @@ POOL_STATUS SimpleQuery(POOL_CONNECTION *frontend,
List *parse_tree_list;
Node *node = NULL;
POOL_STATUS status;
+ char *string;
POOL_SESSION_CONTEXT *session_context;
POOL_QUERY_CONTEXT *query_context;
@@ -151,9 +152,6 @@ POOL_STATUS SimpleQuery(POOL_CONNECTION *frontend,
return POOL_END;
}
- /* Start query processing */
- pool_set_query_in_progress();
-
/* parse SQL string */
parse_tree_list = raw_parser(contents);
@@ -406,7 +404,6 @@ POOL_STATUS SimpleQuery(POOL_CONNECTION *frontend,
if (!commit)
{
char *rewrite_query;
- char *string;
if (node)
{
@@ -463,7 +460,7 @@ POOL_STATUS SimpleQuery(POOL_CONNECTION *frontend,
/*
* Send the query to other than master node.
*/
- if (pool_send_and_wait(query_context, contents, len, -1, MASTER_NODE_ID, "") != POOL_CONTINUE)
+ if (pool_send_and_wait(query_context, string, len, -1, MASTER_NODE_ID, "") != POOL_CONTINUE)
{
free_parser();
return POOL_END;
@@ -472,7 +469,7 @@ POOL_STATUS SimpleQuery(POOL_CONNECTION *frontend,
/* Send "COMMIT" or "ROLLBACK" to only master node if query is "COMMIT" or "ROLLBACK" */
if (commit)
{
- if (pool_send_and_wait(query_context, contents, len, 1, MASTER_NODE_ID, "") != POOL_CONTINUE)
+ if (pool_send_and_wait(query_context, string, len, 1, MASTER_NODE_ID, "") != POOL_CONTINUE)
{
/*
free_parser();
@@ -484,7 +481,7 @@ POOL_STATUS SimpleQuery(POOL_CONNECTION *frontend,
}
else
{
- if (pool_send_and_wait(query_context, contents, len, 1, MASTER_NODE_ID, "") != POOL_CONTINUE)
+ if (pool_send_and_wait(query_context, string, len, 1, MASTER_NODE_ID, "") != POOL_CONTINUE)
{
free_parser();
return POOL_END;
[parent: f5b904847165]