Pass correct information to the executor.
authorPavan Deolasee <[email protected]>
Thu, 15 Jun 2017 05:26:14 +0000 (10:56 +0530)
committerPavan Deolasee <[email protected]>
Thu, 15 Jun 2017 05:26:14 +0000 (10:56 +0530)
While executing RemoteSubplan we'd accidentally set "execute_once" to true,
even though that wasn't appropriate. Correct that mistake and always use the
information in the Portal to decide whether to execute once or more.

src/backend/tcop/pquery.c

index 134dc6dd240490182405b4f5d3b9cd638cf2db39..cb97be771fafb15277142d1267c2abf50e528852 100644 (file)
@@ -2354,7 +2354,8 @@ AdvanceProducingPortal(Portal portal, bool can_wait)
                                /* Execute query and dispatch tuples via dest receiver */
 #define PRODUCE_TUPLES 100
                                PushActiveSnapshot(queryDesc->snapshot);
-                               ExecutorRun(queryDesc, ForwardScanDirection, PRODUCE_TUPLES, true);
+                               ExecutorRun(queryDesc, ForwardScanDirection, PRODUCE_TUPLES,
+                                               portal->run_once);
                                PopActiveSnapshot();
 
                                if (queryDesc->estate->es_processed < PRODUCE_TUPLES)