Skip to content

Commit

Permalink
Fixes text search deparser
Browse files Browse the repository at this point in the history
  • Loading branch information
gurkanindibay committed Dec 26, 2023
1 parent d95a615 commit 2e9ea03
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 65 deletions.
2 changes: 1 addition & 1 deletion src/backend/distributed/commands/distribute_object_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "pg_version_constants.h"

#include "distributed/commands.h"
#include "distributed/comment.h"
#include "distributed/commands/utility_hook.h"
#include "distributed/comment.h"
#include "distributed/deparser.h"
#include "distributed/version_compat.h"

Expand Down
62 changes: 0 additions & 62 deletions src/backend/distributed/deparser/deparse_text_search.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,68 +395,6 @@ DeparseAlterTextSearchDictionarySchemaStmt(Node *node)
}


/*
* DeparseTextSearchConfigurationCommentStmt returns the sql statement representing
* COMMENT ON TEXT SEARCH CONFIGURATION ... IS ...
*/
char *
DeparseTextSearchConfigurationCommentStmt(Node *node)
{
CommentStmt *stmt = castNode(CommentStmt, node);
Assert(stmt->objtype == OBJECT_TSCONFIGURATION);

StringInfoData buf = { 0 };
initStringInfo(&buf);

appendStringInfo(&buf, "COMMENT ON TEXT SEARCH CONFIGURATION %s IS ",
NameListToQuotedString(castNode(List, stmt->object)));

if (stmt->comment == NULL)
{
appendStringInfoString(&buf, "NULL");
}
else
{
appendStringInfoString(&buf, quote_literal_cstr(stmt->comment));
}

appendStringInfoString(&buf, ";");

return buf.data;
}


/*
* DeparseTextSearchDictionaryCommentStmt returns the sql statement representing
* COMMENT ON TEXT SEARCH DICTIONARY ... IS ...
*/
char *
DeparseTextSearchDictionaryCommentStmt(Node *node)
{
CommentStmt *stmt = castNode(CommentStmt, node);
Assert(stmt->objtype == OBJECT_TSDICTIONARY);

StringInfoData buf = { 0 };
initStringInfo(&buf);

appendStringInfo(&buf, "COMMENT ON TEXT SEARCH DICTIONARY %s IS ",
NameListToQuotedString(castNode(List, stmt->object)));

if (stmt->comment == NULL)
{
appendStringInfoString(&buf, "NULL");
}
else
{
appendStringInfoString(&buf, quote_literal_cstr(stmt->comment));
}

appendStringInfoString(&buf, ";");

return buf.data;
}


/*
* AppendStringInfoTokentypeList specializes in adding a comma separated list of
* token_tyoe's to TEXT SEARCH CONFIGURATION commands
Expand Down
2 changes: 0 additions & 2 deletions src/include/distributed/deparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ extern void QualifyAlterRoleSetStmt(Node *stmt);
extern char * DeparseCreateRoleStmt(Node *stmt);
extern char * DeparseDropRoleStmt(Node *stmt);
extern char * DeparseGrantRoleStmt(Node *stmt);
extern char * DeparseRoleCommentStmt(Node *node);
extern char * DeparseReassignOwnedStmt(Node *node);

/* forward declarations for deparse_owned_stmts.c */
Expand All @@ -256,7 +255,6 @@ extern char * DeparseAlterDatabaseRefreshCollStmt(Node *node);
extern char * DeparseAlterDatabaseSetStmt(Node *node);
extern char * DeparseCreateDatabaseStmt(Node *node);
extern char * DeparseDropDatabaseStmt(Node *node);
extern char * DeparseDatabaseCommentStmt(Node *node);
extern char * DeparseAlterDatabaseRenameStmt(Node *node);


Expand Down

0 comments on commit 2e9ea03

Please sign in to comment.