Skip to content

Commit

Permalink
This is a fix for the wrong order of object_classes.
Browse files Browse the repository at this point in the history
Jamin Pan reported the issue and provided the fix.

See #260 for details.

	modified:   src/backend/catalog/dependency.c
  • Loading branch information
koichi-szk committed Jul 13, 2015
1 parent 942e1e3 commit 37347e1
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/backend/catalog/dependency.c
Expand Up @@ -56,6 +56,8 @@
#include "catalog/pg_user_mapping.h"
#ifdef PGXC
#include "catalog/pgxc_class.h"
#include "catalog/pgxc_node.h"
#include "catalog/pgxc_group.h"
#include "pgxc/execRemote.h"
#include "pgxc/pgxc.h"
#include "commands/sequence.h"
Expand Down Expand Up @@ -162,12 +164,14 @@ static const Oid object_classes[MAX_OCLASS] = {
ForeignDataWrapperRelationId, /* OCLASS_FDW */
ForeignServerRelationId, /* OCLASS_FOREIGN_SERVER */
UserMappingRelationId, /* OCLASS_USER_MAPPING */
#ifdef PGXC
PgxcClassRelationId, /* OCLASS_PGXC_CLASS */
PgxcNodeRelationId, /* OCLASS_PGXC_NODE */
PgxcGroupRelationId, /* OCLASS_PGXC_GROUP */
#endif
DefaultAclRelationId, /* OCLASS_DEFACL */
ExtensionRelationId, /* OCLASS_EXTENSION */
EventTriggerRelationId /* OCLASS_EVENT_TRIGGER */
#ifdef PGXC
,PgxcClassRelationId /* OCLASS_PGXCCLASS */
#endif
};


Expand Down Expand Up @@ -1413,6 +1417,11 @@ doDeletion(const ObjectAddress *object, int flags)
case OCLASS_PGXC_CLASS:
RemovePgxcClass(object->objectId);
break;

/*
* OCLASS_PGXC_NODE, OCLASS_PGXC_GROUP intentionally not
* handled here
*/
#endif

case OCLASS_EXTENSION:
Expand Down Expand Up @@ -2486,6 +2495,12 @@ getObjectClass(const ObjectAddress *object)
case PgxcClassRelationId:
Assert(object->objectSubId == 0);
return OCLASS_PGXC_CLASS;

case PgxcNodeRelationId:
return OCLASS_PGXC_NODE;

case PgxcGroupRelationId:
return OCLASS_PGXC_GROUP;
#endif
}

Expand Down

0 comments on commit 37347e1

Please sign in to comment.