mirror of https://github.com/citusdata/citus.git
Fixes review issues
parent
089850f6ed
commit
8387942d92
|
@ -21,14 +21,6 @@
|
||||||
|
|
||||||
#include "distributed/comment.h"
|
#include "distributed/comment.h"
|
||||||
|
|
||||||
|
|
||||||
const CommentStmtType commentStmtTypes[] = {
|
|
||||||
{ OBJECT_DATABASE, "DATABASE" },
|
|
||||||
{ OBJECT_ROLE, "ROLE" }
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static char * GetCommentObjectType(ObjectType objectType);
|
|
||||||
static char * GetCommentForObject(Oid oid);
|
static char * GetCommentForObject(Oid oid);
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +33,7 @@ GetCommentPropagationCommands(Oid oid, char *objectName, ObjectType objectType)
|
||||||
|
|
||||||
/* Get the comment for the database */
|
/* Get the comment for the database */
|
||||||
char *comment = GetCommentForObject(oid);
|
char *comment = GetCommentForObject(oid);
|
||||||
char *commentObjectType = GetCommentObjectType(objectType);
|
char *commentObjectType = ObjectTypeInfos[objectType].name;
|
||||||
|
|
||||||
/* Create the SQL command to propagate the comment to other nodes */
|
/* Create the SQL command to propagate the comment to other nodes */
|
||||||
if (comment != NULL)
|
if (comment != NULL)
|
||||||
|
@ -62,22 +54,6 @@ GetCommentPropagationCommands(Oid oid, char *objectName, ObjectType objectType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static char *
|
|
||||||
GetCommentObjectType(ObjectType objectType)
|
|
||||||
{
|
|
||||||
char *objectName = NULL;
|
|
||||||
for (int i = 0; i < sizeof(commentStmtTypes) / sizeof(CommentStmtType); i++)
|
|
||||||
{
|
|
||||||
if (commentStmtTypes[i].objectType == objectType)
|
|
||||||
{
|
|
||||||
objectName = commentStmtTypes[i].objectName;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return objectName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
GetCommentForObject(Oid oid)
|
GetCommentForObject(Oid oid)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,11 +15,13 @@
|
||||||
|
|
||||||
#include "nodes/parsenodes.h"
|
#include "nodes/parsenodes.h"
|
||||||
|
|
||||||
typedef struct CommentStmtType
|
typedef struct
|
||||||
{
|
{
|
||||||
ObjectType objectType;
|
char *name;
|
||||||
char *objectName;
|
int type;
|
||||||
} CommentStmtType;
|
} ObjectTypeInfo;
|
||||||
|
|
||||||
|
extern const ObjectTypeInfo ObjectTypeInfos[];
|
||||||
|
|
||||||
|
|
||||||
extern List * GetCommentPropagationCommands(Oid oid, char *objectName, ObjectType
|
extern List * GetCommentPropagationCommands(Oid oid, char *objectName, ObjectType
|
||||||
|
|
Loading…
Reference in New Issue