hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject [1/2] incubator-hawq git commit: HAWQ-1068. Fixed crash at calling get_ao_compression_ratio(null)
Date Sun, 09 Oct 2016 02:05:59 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 90bd061ba -> 8928e88ea


HAWQ-1068. Fixed crash at calling get_ao_compression_ratio(null)


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

Branch: refs/heads/master
Commit: 883793482347c502a703481e26564a5666aa3a59
Parents: 90bd061
Author: Ming LI <mli@apache.org>
Authored: Thu Sep 22 15:17:11 2016 +0800
Committer: Ming LI <mli@apache.org>
Committed: Sat Oct 8 10:18:41 2016 +0800

----------------------------------------------------------------------
 src/backend/access/appendonly/aosegfiles.c | 5 +++++
 src/backend/utils/fmgr/fmgr.c              | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/88379348/src/backend/access/appendonly/aosegfiles.c
----------------------------------------------------------------------
diff --git a/src/backend/access/appendonly/aosegfiles.c b/src/backend/access/appendonly/aosegfiles.c
index 993e489..7a57d96 100644
--- a/src/backend/access/appendonly/aosegfiles.c
+++ b/src/backend/access/appendonly/aosegfiles.c
@@ -1549,6 +1549,8 @@ get_ao_compression_ratio_name(PG_FUNCTION_ARGS)
 	Oid				relid;
 
 	/* Assert(Gp_role != GP_ROLE_EXECUTE); */
+	if (NULL == relname)
+		elog(ERROR, "failed to get relname for this function.");
 
 	parentrv = makeRangeVarFromNameList(textToQualifiedNameList(relname));
 	relid = RangeVarGetRelid(parentrv, false, true /*allowHcatalog*/);
@@ -1569,6 +1571,9 @@ get_ao_compression_ratio_oid(PG_FUNCTION_ARGS)
 
 	/* Assert(Gp_role != GP_ROLE_EXECUTE); */
 
+	if (!OidIsValid(relid))
+		elog(ERROR, "failed to get valid relation id for this function.");
+
 	return ao_compression_ratio_internal(relid);
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/88379348/src/backend/utils/fmgr/fmgr.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c
index fe4da74..c1480dc 100644
--- a/src/backend/utils/fmgr/fmgr.c
+++ b/src/backend/utils/fmgr/fmgr.c
@@ -2025,7 +2025,7 @@ OidSendFunctionCall(Oid functionId, Datum val)
 struct varlena *
 pg_detoast_datum(struct varlena * datum)
 {
-	if (VARATT_IS_EXTENDED(datum))
+	if (NULL!=datum && VARATT_IS_EXTENDED(datum))
 		return heap_tuple_untoast_attr(datum);
 	else
 		return datum;


Mime
View raw message