Fixes indentation

pull/7388/head
gurkanindibay 2023-12-26 13:26:23 +03:00
parent a37e542ba8
commit 73685aa6d6
2 changed files with 17 additions and 9 deletions

View File

@ -23,7 +23,7 @@ static char * GetCommentForObject(Oid oid);
List * List *
GetCommentPropagationCommands(Oid oid,char *objectName, ObjectType objectType) GetCommentPropagationCommands(Oid oid, char *objectName, ObjectType objectType)
{ {
List *commands = NIL; List *commands = NIL;
@ -36,11 +36,13 @@ GetCommentPropagationCommands(Oid oid,char *objectName, ObjectType objectType)
/* 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)
{ {
appendStringInfo(commentStmt, "COMMENT ON %s %s IS NULL;", commentObjectType, quote_identifier(objectName)); appendStringInfo(commentStmt, "COMMENT ON %s %s IS NULL;", commentObjectType,
quote_identifier(objectName));
} }
else else
{ {
appendStringInfo(commentStmt, "COMMENT ON %s %s IS %s;", commentObjectType, quote_identifier(objectName), appendStringInfo(commentStmt, "COMMENT ON %s %s IS %s;", commentObjectType,
quote_identifier(objectName),
quote_literal_cstr(comment)); quote_literal_cstr(comment));
} }
@ -51,10 +53,15 @@ GetCommentPropagationCommands(Oid oid,char *objectName, ObjectType objectType)
return commands; return commands;
} }
static char * GetCommentObjectType(ObjectType objectType){
static char *
GetCommentObjectType(ObjectType objectType)
{
char *objectName = NULL; char *objectName = NULL;
for(int i = 0; i < sizeof(commentStmtTypes)/sizeof(CommentStmtType); i++){ for (int i = 0; i < sizeof(commentStmtTypes) / sizeof(CommentStmtType); i++)
if(commentStmtTypes[i].objectType == objectType){ {
if (commentStmtTypes[i].objectType == objectType)
{
objectName = commentStmtTypes[i].objectName; objectName = commentStmtTypes[i].objectName;
break; break;
} }
@ -62,6 +69,7 @@ static char * GetCommentObjectType(ObjectType objectType){
return objectName; return objectName;
} }
static char * static char *
GetCommentForObject(Oid oid) GetCommentForObject(Oid oid)
{ {
@ -100,7 +108,6 @@ GetCommentForObject(Oid oid)
} }
break; break;
} }
} }
/* End the scan and close the catalog */ /* End the scan and close the catalog */

View File

@ -9,4 +9,5 @@ typedef struct CommentStmtType
} CommentStmtType; } CommentStmtType;
extern List * GetCommentPropagationCommands(Oid oid, char *objectName, ObjectType objectType); extern List * GetCommentPropagationCommands(Oid oid, char *objectName, ObjectType
objectType);