hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shiv...@apache.org
Subject [15/50] incubator-hawq git commit: HAWQ-542. Passing empty string to attribute vseg_resource_quota makes default value set instead of reporting error
Date Mon, 21 Mar 2016 22:01:44 GMT
HAWQ-542. Passing empty string to attribute vseg_resource_quota makes default value set instead
of reporting error


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

Branch: refs/heads/HAWQ-459
Commit: 31eb645b44bbd8ec453dbcb33a491c16f3f69178
Parents: ca2a770
Author: YI JIN <yjin@pivotal.io>
Authored: Wed Mar 16 13:37:55 2016 +1100
Committer: YI JIN <yjin@pivotal.io>
Committed: Wed Mar 16 13:37:55 2016 +1100

----------------------------------------------------------------------
 src/backend/resourcemanager/resqueuemanager.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31eb645b/src/backend/resourcemanager/resqueuemanager.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resqueuemanager.c b/src/backend/resourcemanager/resqueuemanager.c
index 7bc0e7b..cbf824e 100644
--- a/src/backend/resourcemanager/resqueuemanager.c
+++ b/src/backend/resourcemanager/resqueuemanager.c
@@ -346,6 +346,17 @@ int shallowparseResourceQueueWithAttributes(List 	*rawattr,
 		case RSQ_DDL_ATTR_NVSEG_UPPER_LIMIT_PERSEG:
 		case RSQ_DDL_ATTR_NVSEG_LOWER_LIMIT_PERSEG:
 		{
+
+			/* The empty value is not allowed. */
+			if ( SimpleStringEmpty(&(property->Val)) )
+			{
+				snprintf(errorbuf, errorbufsize,
+						 "the value of %s cannot be empty",
+						 RSQDDLAttrNames[attrindex]);
+				elog(WARNING, "Resource manager failed parsing attribute, %s",
+							  errorbuf);
+				return RMDDL_WRONG_ATTRVALUE;
+			}
 			/*
 			 * Build property.
 			 *


Mime
View raw message