forked from huawei/openGauss-server
!1657 【轻量级 PR】:修复mxid_to_string在TopMemoryContext分配内存的问题
Merge pull request !1657 from chenxiaobin/N/A
This commit is contained in:
commit
02c14696bf
|
@ -1278,13 +1278,10 @@ static const char *MXStatusToString(MultiXactStatus status)
|
|||
|
||||
static char *mxid_to_string(MultiXactId multi, int nmembers, MultiXactMember *members)
|
||||
{
|
||||
static char *str = NULL;
|
||||
char *str = NULL;
|
||||
StringInfoData buf;
|
||||
int i;
|
||||
|
||||
if (str != NULL)
|
||||
pfree(str);
|
||||
|
||||
initStringInfo(&buf);
|
||||
|
||||
appendStringInfo(&buf, XID_FMT " %d[" XID_FMT " (%s)", multi, nmembers,
|
||||
|
@ -1295,7 +1292,7 @@ static char *mxid_to_string(MultiXactId multi, int nmembers, MultiXactMember *me
|
|||
}
|
||||
|
||||
appendStringInfoChar(&buf, ']');
|
||||
str = MemoryContextStrdup(TopMemoryContext, buf.data);
|
||||
str = MemoryContextStrdup(SESS_GET_MEM_CXT_GROUP(MEMORY_CONTEXT_STORAGE), buf.data);
|
||||
pfree(buf.data);
|
||||
return str;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue