pgpool2.git / summary / log / commit / refs
commit 4a581a79fdc816620e5df4f49d117ebb1864c784
Author: Tatsuo Ishii <ishii at sraoss.co.jp>
Date: Mon Dec 04 05:49:12 2006 +0000
Fix bug with replication mode. With UPDATE/DELETE, the number of
affcted rows should not be sum of each node.
pool_process_query.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/pool_process_query.c b/pool_process_query.c
index 26b1effd1..93455580c 100644
--- a/pool_process_query.c
+++ b/pool_process_query.c
@@ -2879,7 +2879,7 @@ POOL_STATUS SimpleForwardToFrontend(char kind, POOL_CONNECTION *frontend, POOL_C
}
}
- if (kind == 'C')
+ if (kind == 'C') /* packet kind is "Command Complete"? */
{
char *rows;
@@ -2888,7 +2888,23 @@ POOL_STATUS SimpleForwardToFrontend(char kind, POOL_CONNECTION *frontend, POOL_C
delete_or_update = 1;
rows += 7;
- command_ok_row_count += atoi(rows);
+
+ /*
+ * if we are in the parallel mode, we have to sum up the number
+ * of affected rows
+ */
+ if (PARALLEL_MODE)
+ {
+ command_ok_row_count += atoi(rows);
+ }
+
+ /*
+ * else we just set the number of affected rows of the master node
+ */
+ else if (IS_MASTER_NODE_ID(i))
+ {
+ command_ok_row_count = atoi(rows);
+ }
}
}
}
[parent: 881cd04eeec0]