From 55676a7d1263619df11ebb8cec01f4e3228cee54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=B2=B2=E9=B9=8F?= Date: Thu, 3 Sep 2020 17:05:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../optimizer/commands/functioncmds.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gausskernel/optimizer/commands/functioncmds.cpp b/src/gausskernel/optimizer/commands/functioncmds.cpp index 435a7732b..f977a725c 100755 --- a/src/gausskernel/optimizer/commands/functioncmds.cpp +++ b/src/gausskernel/optimizer/commands/functioncmds.cpp @@ -98,7 +98,7 @@ static const int PRO_RETURN_SET_COST = 1000; * validator, so as not to produce a NOTICE and then an ERROR for the same * condition.) */ - static void CheckIsSerialType(TypeName* t) +static void CheckIsSerialType(TypeName* t) { bool isSerial = false; /* Check for SERIAL pseudo-types */ @@ -144,7 +144,7 @@ static void compute_return_type( * namespace, if the owner of the namespce has the same name as the namescpe */ bool isalter = false; - + CheckIsSerialType(returnType); typtup = LookupTypeName(NULL, returnType, NULL); @@ -287,6 +287,17 @@ static void examine_parameter_list(List* parameters, Oid languageOid, const char CheckIsSerialType(t); + typtup = LookupTypeName(NULL, t, NULL); + /* + * If the type is relation, then we check + * whether the table is in installation group + */ + if (!in_logic_cluster() && !IsTypeTableInInstallationGroup(typtup)) { + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("argument type '%s' must be in installation group", TypeNameToString(t)))); + } + if (typtup) { if (!((Form_pg_type)GETSTRUCT(typtup))->typisdefined) { /* As above, hard error if language is SQL */