unusing typename+typenamespace to override typeoid in read\out funcs

This commit is contained in:
gentle_hu
2022-03-09 11:55:18 +08:00
parent c10de5f198
commit 14bf3a2139
2 changed files with 26 additions and 0 deletions

View File

@ -115,7 +115,10 @@
/*
* For the new created type, we have to bind the typname and typnamespace information
* so that the data node can decode it.
* But in single node, we don't need it.
*/
#ifdef ENABLE_MULTIPLE_NODES
#define WRITE_TYPEINFO_WITHOID(typid) \
if ((typid) >= FirstBootstrapObjectId && IsStatisfyUpdateCompatibility(typid)) { \
char* exprtypename = NULL; \
@ -151,6 +154,14 @@
WRITE_TYPEINFO_WITHOID(typid) \
} \
} while (0)
#else /* not def ENABLE_MULTIPLE_NODES */
#define WRITE_TYPEINFO_WITHOID(typid) ((void)0)
#define WRITE_TYPEINFO_FIELD(fldname) ((void)0)
#define WRITE_TYPEINFO_LIST(fldname) ((void)0)
#define WRITE_TYPEINFO_ARRAY(fldname, size) ((void)0)
#endif /* ENABLE_MULTIPLE_NODES */
/*
* Write full-text search configuration's name out of its oid

View File

@ -401,6 +401,13 @@ THR_LOCAL bool skip_read_extern_fields = false;
token = pg_strtok(&length); /* skip :fldname */ \
local_node->fldname = _readBitmapset()
/*
* For the new created type, we have to bind the typname and typnamespace information
* so that the data node can decode it.
* But in single node, we don't need it.
*/
#ifdef ENABLE_MULTIPLE_NODES
#define READ_TYPEINFO_FIELD(fldname) \
do { \
if (local_node->fldname >= FirstBootstrapObjectId) { \
@ -462,6 +469,14 @@ THR_LOCAL bool skip_read_extern_fields = false;
READ_TYPEINFO(local_node->fldname[i]); \
} \
} while (0);
#else /* not def ENABLE_MULTIPLE_NODES */
#define READ_TYPEINFO_FIELD(fldname) ((void)0)
#define READ_TYPEINFO(typePtr) ((void)0)
#define READ_TYPEINFO_LIST(fldname) ((void)0)
#define READ_TYPINFO_ARRAY(fldname, size) ((void)0)
#endif /* ENABLE_MULTIPLE_NODES */
/* read full-text search configuratio's oid from its name */
#define READ_CFGINFO_FIELD(fldname1, fldname2) \