hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject incubator-hawq git commit: HAWQ-218. Core dump while selecting data from partitioned table with where condition that belongs to no partition
Date Thu, 17 Dec 2015 08:06:25 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 272baf39a -> 59f94f2cd


HAWQ-218. Core dump while selecting data from partitioned table with where condition that
belongs to no partition


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/59f94f2c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/59f94f2c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/59f94f2c

Branch: refs/heads/master
Commit: 59f94f2cd9b8e7c2bc2862f913337ff2db594ed0
Parents: 272baf3
Author: Ruilong Huo <rhuo@pivotal.io>
Authored: Wed Dec 16 20:36:15 2015 -0800
Committer: Ruilong Huo <rhuo@pivotal.io>
Committed: Thu Dec 17 16:06:09 2015 +0800

----------------------------------------------------------------------
 src/backend/optimizer/plan/planner.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/59f94f2c/src/backend/optimizer/plan/planner.c
----------------------------------------------------------------------
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index b09389a..4a7a509 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -274,6 +274,8 @@ planner(Query *parse, int cursorOptions,
 	static bool resourceNegotiateDone = false;
 	QueryResource *savedQueryResource = GetActiveQueryResource();;
 	SetActiveRelType(NIL);
+
+	bool isDispatchParallel = false;
 	/*
 	 * Before doing the true query optimization, we first run a resource_negotiator to give
 	 * us some sense of the complexity of the query, and allocate the appropriate
@@ -288,6 +290,11 @@ planner(Query *parse, int cursorOptions,
       START_MEMORY_ACCOUNT(MemoryAccounting_CreateAccount(0, MEMORY_OWNER_TYPE_Resource_Negotiator));
       {
         resource_negotiator(parse, cursorOptions, boundParams, resourceLife, &ppResult);
+
+		if(ppResult->stmt && ppResult->stmt->planTree)
+		{
+			isDispatchParallel = ppResult->stmt->planTree->dispatch == DISPATCH_PARALLEL;
+		}
       }
       END_MEMORY_ACCOUNT();
 	  }
@@ -327,7 +334,7 @@ planner(Query *parse, int cursorOptions,
 		* then fall back to the planner.
 		* TODO: caragg 11/08/2013: Enable ORCA when running in utility mode (MPP-21841)
 		*/
-    	if (optimizer && AmIMaster() && (GP_ROLE_UTILITY != Gp_role))
+    	if (optimizer && AmIMaster() && (GP_ROLE_UTILITY != Gp_role) &&
isDispatchParallel)
 		{
 			if (gp_log_optimization_time)
 			{


Mime
View raw message