From dfcc7932a0663cdae8626697206df3e1f26010ae Mon Sep 17 00:00:00 2001 From: Sait Talha Nisanci Date: Thu, 26 Aug 2021 23:49:11 +0300 Subject: [PATCH] fixup! Introduces getObjectTypeDescription_compat and getObjectIdentity_compat macros --- src/backend/distributed/commands/dependencies.c | 2 +- src/backend/distributed/commands/function.c | 9 ++++++--- src/backend/distributed/metadata/distobject.c | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/backend/distributed/commands/dependencies.c b/src/backend/distributed/commands/dependencies.c index f8638888d..8561ad4df 100644 --- a/src/backend/distributed/commands/dependencies.c +++ b/src/backend/distributed/commands/dependencies.c @@ -251,7 +251,7 @@ GetDependencyCreateDDLCommands(const ObjectAddress *dependency) */ Assert(false); ereport(ERROR, (errmsg("unsupported object %s for distribution by citus", - getObjectTypeDescription_compat(dependency, false)), + getObjectTypeDescription_compat(dependency, /* missingOk: */ false)), errdetail( "citus tries to recreate an unsupported object on its workers"), errhint("please report a bug as this should not be happening"))); diff --git a/src/backend/distributed/commands/function.c b/src/backend/distributed/commands/function.c index 71f0d6124..e6a646735 100644 --- a/src/backend/distributed/commands/function.c +++ b/src/backend/distributed/commands/function.c @@ -1613,7 +1613,8 @@ PreprocessAlterFunctionDependsStmt(Node *node, const char *queryString, * workers */ - const char *functionName = getObjectIdentity_compat(&address, false); + const char *functionName = + getObjectIdentity_compat(&address, /* missingOk: */ false); ereport(ERROR, (errmsg("distrtibuted functions are not allowed to depend on an " "extension"), errdetail("Function \"%s\" is already distributed. Functions from " @@ -1932,8 +1933,10 @@ ErrorIfFunctionDependsOnExtension(const ObjectAddress *functionAddress) if (IsObjectAddressOwnedByExtension(functionAddress, &extensionAddress)) { - char *functionName = getObjectIdentity_compat(functionAddress, false); - char *extensionName = getObjectIdentity_compat(&extensionAddress, false); + char *functionName = + getObjectIdentity_compat(functionAddress, /* missingOk: */ false); + char *extensionName = + getObjectIdentity_compat(&extensionAddress, /* missingOk: */ false); ereport(ERROR, (errmsg("unable to create a distributed function from functions " "owned by an extension"), errdetail("Function \"%s\" has a dependency on extension \"%s\". " diff --git a/src/backend/distributed/metadata/distobject.c b/src/backend/distributed/metadata/distobject.c index 215fb2943..b96db6ed0 100644 --- a/src/backend/distributed/metadata/distobject.c +++ b/src/backend/distributed/metadata/distobject.c @@ -75,8 +75,8 @@ citus_unmark_object_distributed(PG_FUNCTION_ARGS) { ereport(ERROR, (errmsg("object still exists"), errdetail("the %s \"%s\" still exists", - getObjectTypeDescription_compat(&address, false), - getObjectIdentity_compat(&address, false)), + getObjectTypeDescription_compat(&address, /* missingOk: */ false), + getObjectIdentity_compat(&address, /* missingOk: */ false)), errhint("drop the object via a DROP command"))); }