Fix duplicate NodeTag enum in nodes.h. master
authorTatsuo Ishii <[email protected]>
Wed, 24 Dec 2025 06:46:54 +0000 (15:46 +0900)
committerTatsuo Ishii <[email protected]>
Wed, 24 Dec 2025 07:59:56 +0000 (16:59 +0900)
The file was imported from PostgreSQL and Pgpool-II specific node type
were added right after T_Invalid = 0, then nodetags.h is
included. Since nodetags.h explicitly assign values to each enum
starting from 1, and this created duplicated enums.
T_List = 1,
T_Alias = 2,
T_RangeVar = 3,
T_PgpoolVariableSetStmt, (1)
T_PgpoolVariableShowStmt, (2)
T_PgpoolQueryCacheStmt, (3)

Although fortunately this seems does not create any trouble except the
duplicated enums, this should be fixed: moving the inclusion of
nodetags.h right after "T_invalid = 0".

Reported-by: liujinyang-highgo
Diagnosed-by: liujinyang-highgo
Discussion: https://github.com/pgpool/pgpool2/issues/138
Backpatch-through: v4.5

src/include/parser/nodes.h

index 27569478692436859b17e7cea9637a76d923b274..5412ef4c8da072ce50049409235ea7aca1369a7d 100644 (file)
 typedef enum NodeTag
 {
        T_Invalid = 0,
 typedef enum NodeTag
 {
        T_Invalid = 0,
-
+#include "nodetags.h"
        /* pgpool Extension */
        T_PgpoolVariableSetStmt,
        T_PgpoolVariableShowStmt,
        T_PgpoolQueryCacheStmt,
        /* pgpool Extension */
        T_PgpoolVariableSetStmt,
        T_PgpoolVariableShowStmt,
        T_PgpoolQueryCacheStmt,
-#include "nodetags.h"
 } NodeTag;
 
 /*
 } NodeTag;
 
 /*