mirror of https://github.com/citusdata/citus.git
we supress notice log during looking up function oid to not break pg vanilla tests. (#6082)
parent
5490c85f49
commit
f372e93d22
|
@ -32,6 +32,7 @@
|
|||
#include "catalog/pg_proc.h"
|
||||
#include "catalog/pg_type.h"
|
||||
#include "commands/extension.h"
|
||||
#include "distributed/citus_depended_object.h"
|
||||
#include "distributed/citus_ruleutils.h"
|
||||
#include "distributed/citus_safe_lib.h"
|
||||
#include "distributed/colocation_utils.h"
|
||||
|
@ -1438,7 +1439,17 @@ CreateFunctionStmtObjectAddress(Node *node, bool missing_ok)
|
|||
}
|
||||
}
|
||||
|
||||
return FunctionToObjectAddress(objectType, objectWithArgs, missing_ok);
|
||||
int OldClientMinMessage = client_min_messages;
|
||||
|
||||
/* suppress NOTICE if running under pg vanilla tests */
|
||||
SetLocalClientMinMessagesIfRunningPGTests(WARNING);
|
||||
|
||||
List *funcAddresses = FunctionToObjectAddress(objectType, objectWithArgs, missing_ok);
|
||||
|
||||
/* set it back */
|
||||
SetLocalClientMinMessagesIfRunningPGTests(OldClientMinMessage);
|
||||
|
||||
return funcAddresses;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -595,6 +595,21 @@ StartupCitusBackend(void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* GetCurrentClientMinMessageLevelName returns the name of the
|
||||
* the GUC client_min_messages for its specified value.
|
||||
*/
|
||||
const char *
|
||||
GetClientMinMessageLevelNameForValue(int minMessageLevel)
|
||||
{
|
||||
struct config_enum record = { 0 };
|
||||
record.options = log_level_options;
|
||||
const char *clientMinMessageLevelName = config_enum_lookup_by_value(&record,
|
||||
minMessageLevel);
|
||||
return clientMinMessageLevelName;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* RegisterConnectionCleanup cleans up any resources left at the end of the
|
||||
* session. We prefer to cleanup before shared memory exit to make sure that
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include "distributed/citus_depended_object.h"
|
||||
#include "distributed/metadata_cache.h"
|
||||
#include "distributed/listutils.h"
|
||||
#include "distributed/log_utils.h"
|
||||
#include "distributed/shared_library_init.h"
|
||||
#include "nodes/makefuncs.h"
|
||||
#include "nodes/nodeFuncs.h"
|
||||
#include "nodes/parsenodes.h"
|
||||
|
@ -76,6 +78,27 @@ SetLocalHideCitusDependentObjectsDisabledWhenAlreadyEnabled(void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* SetLocalClientMinMessagesIfRunningPGTests sets client_min_message locally to the given value
|
||||
* if EnableUnsupportedFeatureMessages is set to false.
|
||||
*/
|
||||
void
|
||||
SetLocalClientMinMessagesIfRunningPGTests(int clientMinMessageLevel)
|
||||
{
|
||||
if (EnableUnsupportedFeatureMessages)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const char *clientMinMessageLevelName = GetClientMinMessageLevelNameForValue(
|
||||
clientMinMessageLevel);
|
||||
|
||||
set_config_option("client_min_messages", clientMinMessageLevelName,
|
||||
(superuser() ? PGC_SUSET : PGC_USERSET), PGC_S_SESSION,
|
||||
GUC_ACTION_LOCAL, true, 0, false);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* HideCitusDependentObjectsOnQueriesOfPgMetaTables adds a NOT is_citus_depended_object(oid, oid) expr
|
||||
* to the quals of meta class RTEs that we are interested in.
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
extern bool HideCitusDependentObjects;
|
||||
|
||||
extern void SetLocalClientMinMessagesIfRunningPGTests(int
|
||||
clientMinMessageLevel);
|
||||
extern void SetLocalHideCitusDependentObjectsDisabledWhenAlreadyEnabled(void);
|
||||
extern bool HideCitusDependentObjectsOnQueriesOfPgMetaTables(Node *node, void *context);
|
||||
extern bool IsPgLocksTable(RangeTblEntry *rte);
|
||||
|
|
|
@ -23,5 +23,6 @@ extern IsColumnarTableAmTable_type extern_IsColumnarTableAmTable;
|
|||
extern ReadColumnarOptions_type extern_ReadColumnarOptions;
|
||||
|
||||
extern void StartupCitusBackend(void);
|
||||
extern const char * GetClientMinMessageLevelNameForValue(int minMessageLevel);
|
||||
|
||||
#endif /* SHARED_LIBRARY_INIT_H */
|
||||
|
|
Loading…
Reference in New Issue