!3109 _copyCreateTrigStmt中funcSource复制

Merge pull request !3109 from 暖阳/fix_bug
This commit is contained in:
opengauss-bot
2023-04-26 01:29:45 +00:00
committed by Gitee
5 changed files with 28 additions and 4 deletions

View File

@ -4552,6 +4552,15 @@ static IndexHintDefinition* _copyIndexHintDefinition(const IndexHintDefinition*
return newnode;
}
static FunctionSources* _copyFunctionSources(const FunctionSources* from)
{
FunctionSources* newnode = makeNode(FunctionSources);
COPY_STRING_FIELD(headerSrc);
COPY_STRING_FIELD(bodySrc);
return newnode;
}
static SkewRelInfo* _copySkewRelInfo(const SkewRelInfo* from)
{
SkewRelInfo* newnode = makeNode(SkewRelInfo);
@ -6260,7 +6269,7 @@ static CreateTrigStmt* _copyCreateTrigStmt(const CreateTrigStmt* from)
COPY_STRING_FIELD(trgordername);
COPY_SCALAR_FIELD(is_follows);
COPY_STRING_FIELD(schemaname);
return newnode;
}
@ -8686,6 +8695,9 @@ void* copyObject(const void* from)
case T_IndexHintDefinition:
retval = _copyIndexHintDefinition((IndexHintDefinition *)from);
break;
case T_FunctionSources:
retval = _copyFunctionSources((FunctionSources *)from);
break;
default:
ereport(ERROR,
(errcode(ERRCODE_UNRECOGNIZED_NODE_TYPE), errmsg("copyObject: unrecognized node type: %d", (int)nodeTag(from))));

View File

@ -2155,6 +2155,13 @@ static bool _equalIndexHintRelationData (const IndexHintRelationData* a, const I
return true;
}
static bool _equalFunctionSources(const FunctionSources* a, const FunctionSources* b)
{
COMPARE_STRING_FIELD(headerSrc);
COMPARE_STRING_FIELD(bodySrc);
return true;
}
static bool _equalCreatePolicyLabelStmt(const CreatePolicyLabelStmt* a, const CreatePolicyLabelStmt* b)
{
COMPARE_SCALAR_FIELD(if_not_exists);
@ -4435,7 +4442,9 @@ bool equal(const void* a, const void* b)
case T_IndexHintRelationData:
retval = _equalIndexHintRelationData((IndexHintRelationData *)a, (IndexHintRelationData *)b);
break;
case T_FunctionSources:
retval = _equalFunctionSources((const FunctionSources *)a, (const FunctionSources *)b);
break;
default:
ereport(ERROR,

View File

@ -604,7 +604,8 @@ static const TagStr g_tagStrArr[] = {{T_Invalid, "Invalid"},
{T_SetVariableExpr, "SetVariableExpr"},
{T_VariableMultiSetStmt, "VariableMultiSetStmt"},
{T_IndexHintDefinition, "IndexHintDefinition"},
{T_IndexHintRelationData, "IndexHintRelationData"}
{T_IndexHintRelationData, "IndexHintRelationData"},
{T_FunctionSources, "FunctionSources"}
};
char* nodeTagToString(NodeTag tag)

View File

@ -827,7 +827,8 @@ typedef enum NodeTag {
T_CentroidPoint,
T_UserSetElem,
T_UserVar,
T_CharsetCollateOptions
T_CharsetCollateOptions,
T_FunctionSources
} NodeTag;
/* if you add to NodeTag also need to add nodeTagToString */

View File

@ -2223,6 +2223,7 @@ typedef struct CreateFunctionStmt {
} CreateFunctionStmt;
typedef struct FunctionSources {
NodeTag type;
char* headerSrc;
char* bodySrc;
} FunctionSources;