From 23a99a487b802d494a8c857d905b44e4b5df53ed Mon Sep 17 00:00:00 2001 From: Zhang Mingli Date: Thu, 11 Jul 2024 22:51:27 +0800 Subject: [PATCH] Define EXT_OID_START to suggest oid range for extensions. Fix GpMatviewAuxId duplicates oid with other extensions. All extension should use oids start from EXT_OID_START to avoid this issue. Authored-by: Zhang Mingli avamingli@gmail.com --- src/include/catalog/gp_matview_aux.h | 2 +- src/include/catalog/gp_oid_divide.h | 30 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/include/catalog/gp_oid_divide.h diff --git a/src/include/catalog/gp_matview_aux.h b/src/include/catalog/gp_matview_aux.h index a9beaad4244..03f6a2300f6 100644 --- a/src/include/catalog/gp_matview_aux.h +++ b/src/include/catalog/gp_matview_aux.h @@ -23,7 +23,7 @@ /* * Defines for gp_matview_aux */ -CATALOG(gp_matview_aux,7061,GpMatviewAuxId) BKI_SHARED_RELATION +CATALOG(gp_matview_aux,7153,GpMatviewAuxId) BKI_SHARED_RELATION { Oid mvoid; /* materialized view oid */ NameData mvname; /* materialized view name */ diff --git a/src/include/catalog/gp_oid_divide.h b/src/include/catalog/gp_oid_divide.h new file mode 100644 index 00000000000..d23fedc2c19 --- /dev/null +++ b/src/include/catalog/gp_oid_divide.h @@ -0,0 +1,30 @@ +/*------------------------------------------------------------------------- + * + * oid_divide.h + * + * Portions Copyright (c) 2024-Present HashData, Inc. or its affiliates. + * + * + * IDENTIFICATION + * src/include/catalog/oid_divide.h + * + * NOTES + * This is used to divide oid range for core and extensions + * to avoid duplicated. + * + *------------------------------------------------------------------------- + */ + +#ifndef GP_OID_DIVIDE_H +#define GP_OID_DIVIDE_H + +/* + * Extensions should use Oids start from EXT_OID_START! + * + * To avoid duplicated oids across extensions or repos. + * We strongly suggest extesions should begin from EXT_OID_START + * to separate kernel and extensions. + */ +#define EXT_OID_START 9932 + +#endif /* GP_OID_DIVIDE_H */