pgpool2.git / summary / log / commit / refs
commit a68d26905f14ba541f917c43ee170f1b490a44b4
Author: Toshihiro Kitagawa <kitagawa at sraoss.co.jp>
Date: Fri Aug 13 00:09:46 2010 +0000
Fix the bug that V2 protocol does not work.
pool_process_query.c | 5 +++--
pool_proto_modules.c | 10 +++++-----
pool_proto_modules.h | 3 ++-
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/pool_process_query.c b/pool_process_query.c
index 76dd17784..095848074 100644
--- a/pool_process_query.c
+++ b/pool_process_query.c
@@ -87,6 +87,7 @@ POOL_STATUS pool_process_query(POOL_CONNECTION *frontend,
int reset_request)
{
char kind; /* packet kind (backend) */
+ short num_fields = 0; /* the number of fields in a row (V2 protocol) */
fd_set readmask;
fd_set writemask;
fd_set exceptmask;
@@ -328,7 +329,7 @@ POOL_STATUS pool_process_query(POOL_CONNECTION *frontend,
sleep(5);
break;
}
- status = ProcessBackendResponse(frontend, backend, &state);
+ status = ProcessBackendResponse(frontend, backend, &state, &num_fields);
if (status != POOL_CONTINUE)
return status;
break;
@@ -398,7 +399,7 @@ POOL_STATUS pool_process_query(POOL_CONNECTION *frontend,
got_sighup = 0;
}
- status = ProcessBackendResponse(frontend, backend, &state);
+ status = ProcessBackendResponse(frontend, backend, &state, &num_fields);
if (status != POOL_CONTINUE)
return status;
diff --git a/pool_proto_modules.c b/pool_proto_modules.c
index 861207e12..671802165 100644
--- a/pool_proto_modules.c
+++ b/pool_proto_modules.c
@@ -1819,11 +1819,11 @@ POOL_STATUS ProcessFrontendResponse(POOL_CONNECTION *frontend,
}
POOL_STATUS ProcessBackendResponse(POOL_CONNECTION *frontend,
- POOL_CONNECTION_POOL *backend, int *state)
+ POOL_CONNECTION_POOL *backend,
+ int *state, short *num_fields)
{
int status;
char kind;
- short num_fields = 0;
POOL_SESSION_CONTEXT *session_context;
/* Get session context */
@@ -1952,7 +1952,7 @@ POOL_STATUS ProcessBackendResponse(POOL_CONNECTION *frontend,
break;
case 'B': /* BinaryRow */
- status = BinaryRow(frontend, backend, num_fields);
+ status = BinaryRow(frontend, backend, *num_fields);
break;
case 'C': /* CompletedResponse */
@@ -1960,7 +1960,7 @@ POOL_STATUS ProcessBackendResponse(POOL_CONNECTION *frontend,
break;
case 'D': /* AsciiRow */
- status = AsciiRow(frontend, backend, num_fields);
+ status = AsciiRow(frontend, backend, *num_fields);
break;
case 'E': /* ErrorResponse */
@@ -1990,7 +1990,7 @@ POOL_STATUS ProcessBackendResponse(POOL_CONNECTION *frontend,
break;
case 'T': /* RowDescription */
- status = RowDescription(frontend, backend, &num_fields);
+ status = RowDescription(frontend, backend, num_fields);
break;
case 'V': /* FunctionResultResponse and FunctionVoidResponse */
diff --git a/pool_proto_modules.h b/pool_proto_modules.h
index b52237d9a..1d239f412 100644
--- a/pool_proto_modules.h
+++ b/pool_proto_modules.h
@@ -117,7 +117,8 @@ extern POOL_STATUS ProcessFrontendResponse(POOL_CONNECTION *frontend,
POOL_CONNECTION_POOL *backend);
extern POOL_STATUS ProcessBackendResponse(POOL_CONNECTION *frontend,
- POOL_CONNECTION_POOL *backend, int *state);
+ POOL_CONNECTION_POOL *backend,
+ int *state, short *num_fields);
/*
* modules defined in pool_proto2.c
[parent: a00fbfe5970d]