sort_objects
Onder Kalaci 2022-02-25 16:33:25 +01:00
parent 6c25eea62f
commit aef3eb8c23
3 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,6 @@
typedef bool (*AddressPredicate)(const ObjectAddress *);
static int ObjectAddressComparator(const void *a, const void *b);
static List * GetDependencyCreateDDLCommands(const ObjectAddress *dependency);
static List * FilterObjectAddressListByPredicate(List *objectAddressList,
AddressPredicate predicate);
@ -136,7 +135,7 @@ EnsureDependenciesExistOnAllNodes(const ObjectAddress *target)
/*
* Copied from PG object_address_comparator function to compare ObjectAddresses.
*/
static int
int
ObjectAddressComparator(const void *a, const void *b)
{
const ObjectAddress *obja = (const ObjectAddress *) a;

View File

@ -823,6 +823,8 @@ MarkObjectsDistributedCreateCommand(List *addresses,
List *colocationIds,
List *forceDelegations)
{
addresses = SortList(addresses, ObjectAddressComparator);
StringInfo insertDistributedObjectsCommand = makeStringInfo();
Assert(list_length(addresses) == list_length(distributionArgumentIndexes));

View File

@ -250,6 +250,7 @@ extern List * GetDistributableDependenciesForObject(const ObjectAddress *target)
extern bool ShouldPropagate(void);
extern bool ShouldPropagateObject(const ObjectAddress *address);
extern List * ReplicateAllObjectsToNodeCommandList(const char *nodeName, int nodePort);
extern int ObjectAddressComparator(const void *a, const void *b);
/* Remaining metadata utility functions */
extern char * TableOwner(Oid relationId);