Useless field ispartitioned in CreateStmtContext

Поиск
Список
Период
Сортировка
Искать
От
hugo
Тема
Useless field ispartitioned in CreateStmtContext
Дата
Msg-id
tencent_DEA1B549FA4AE0EE6F55BBE9A685FD16730A@qq.com
Список
Дерево обсуждения
Useless field ispartitioned in CreateStmtContext hugo <2689496754@qq.com>
Re: Useless field ispartitioned in CreateStmtContext Alena Rybakina <a.rybakina@postgrespro.ru>
Re: Useless field ispartitioned in CreateStmtContext Kirill Reshke <reshkekirill@gmail.com>
Re: Useless field ispartitioned in CreateStmtContext Kirill Reshke <reshkekirill@gmail.com>
Re: Useless field ispartitioned in CreateStmtContext Kirill Reshke <reshkekirill@gmail.com>

Hi!

       When looking at the partition-related code, I found that the ispartitioned

field in CreateStmtContext is not used. It looks like we can safely remove it and

avoid invalid assignment logic.

 

Here's a very simple fixany suggestion?

 

diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c

index 1e15ce10b48..6dea85cc2dc 100644

--- a/src/backend/parser/parse_utilcmd.c

+++ b/src/backend/parser/parse_utilcmd.c

@@ -89,7 +89,6 @@ typedef struct

        List       *alist;                      /* "after list" of things to do after creating

                                                                 * the table */

        IndexStmt  *pkey;                       /* PRIMARY KEY index, if any */

-       bool            ispartitioned;  /* true if table is partitioned */

        PartitionBoundSpec *partbound;  /* transformed FOR VALUES */

        bool            ofType;                 /* true if statement contains OF typename */

} CreateStmtContext;

@@ -246,7 +245,6 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString)

        cxt.blist = NIL;

        cxt.alist = NIL;

        cxt.pkey = NULL;

-       cxt.ispartitioned = stmt->partspec != NULL;

        cxt.partbound = stmt->partbound;

        cxt.ofType = (stmt->ofTypename != NULL);

@@ -3401,7 +3399,6 @@ transformAlterTableStmt(Oid relid, AlterTableStmt *stmt,

        cxt.blist = NIL;

        cxt.alist = NIL;

        cxt.pkey = NULL;

-       cxt.ispartitioned = (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);

        cxt.partbound = NULL;

        cxt.ofType = false;

 

--

Best regards,

hugozhang

В списке pgsql-hackers по дате отправления
От: jian he
Дата:
Сообщение: Re: general purpose array_sort
От: Melanie Plageman
Дата:
FAQ