Index: pool_query_context.c
===================================================================
RCS file: /cvsroot/pgpool/pgpool-II/pool_query_context.c,v
retrieving revision 1.32.2.5
diff -u -r1.32.2.5 pool_query_context.c
--- pool_query_context.c	18 Feb 2011 13:35:10 -0000	1.32.2.5
+++ pool_query_context.c	7 Mar 2011 10:50:51 -0000
@@ -303,6 +303,14 @@
 	{
 		pool_set_node_to_be_sent(query_context,
 								 MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID);
+		for (i=0;i<NUM_BACKENDS;i++)
+		{
+			if (query_context->where_to_send[i])
+			{
+				query_context->virtual_master_node_id = i;
+				break;
+			}
+		}
 		return;
 	}
 
