Skip to content

Commit 49a7301

Browse files
committed
Add missing copyfuncs/equalfuncs support for AlterTSDictionaryStmt and
AlterTSConfigurationStmt. All utility statement node types are expected to be supported here, though they do not have to have outfuncs/readfuncs support. Found by running regression tests with COPY_PARSE_PLAN_TREES enabled.
1 parent 1f6fc49 commit 49a7301

File tree

2 files changed

+63
-3
lines changed

2 files changed

+63
-3
lines changed

src/backend/nodes/copyfuncs.c

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Portions Copyright (c) 1994, Regents of the University of California
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.387 2008/01/01 19:45:50 momjian Exp $
18+
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.388 2008/02/07 20:19:47 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -2897,6 +2897,32 @@ _copyReassignOwnedStmt(ReassignOwnedStmt *from)
28972897
return newnode;
28982898
}
28992899

2900+
static AlterTSDictionaryStmt *
2901+
_copyAlterTSDictionaryStmt(AlterTSDictionaryStmt *from)
2902+
{
2903+
AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
2904+
2905+
COPY_NODE_FIELD(dictname);
2906+
COPY_NODE_FIELD(options);
2907+
2908+
return newnode;
2909+
}
2910+
2911+
static AlterTSConfigurationStmt *
2912+
_copyAlterTSConfigurationStmt(AlterTSConfigurationStmt *from)
2913+
{
2914+
AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
2915+
2916+
COPY_NODE_FIELD(cfgname);
2917+
COPY_NODE_FIELD(tokentype);
2918+
COPY_NODE_FIELD(dicts);
2919+
COPY_SCALAR_FIELD(override);
2920+
COPY_SCALAR_FIELD(replace);
2921+
COPY_SCALAR_FIELD(missing_ok);
2922+
2923+
return newnode;
2924+
}
2925+
29002926
/* ****************************************************************
29012927
* pg_list.h copy functions
29022928
* ****************************************************************
@@ -3489,6 +3515,12 @@ copyObject(void *from)
34893515
case T_ReassignOwnedStmt:
34903516
retval = _copyReassignOwnedStmt(from);
34913517
break;
3518+
case T_AlterTSDictionaryStmt:
3519+
retval = _copyAlterTSDictionaryStmt(from);
3520+
break;
3521+
case T_AlterTSConfigurationStmt:
3522+
retval = _copyAlterTSConfigurationStmt(from);
3523+
break;
34923524

34933525
case T_A_Expr:
34943526
retval = _copyAExpr(from);

src/backend/nodes/equalfuncs.c

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Portions Copyright (c) 1994, Regents of the University of California
1919
*
2020
* IDENTIFICATION
21-
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.317 2008/01/01 19:45:50 momjian Exp $
21+
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.318 2008/02/07 20:19:47 tgl Exp $
2222
*
2323
*-------------------------------------------------------------------------
2424
*/
@@ -1637,6 +1637,29 @@ _equalReassignOwnedStmt(ReassignOwnedStmt *a, ReassignOwnedStmt *b)
16371637
return true;
16381638
}
16391639

1640+
static bool
1641+
_equalAlterTSDictionaryStmt(AlterTSDictionaryStmt *a, AlterTSDictionaryStmt *b)
1642+
{
1643+
COMPARE_NODE_FIELD(dictname);
1644+
COMPARE_NODE_FIELD(options);
1645+
1646+
return true;
1647+
}
1648+
1649+
static bool
1650+
_equalAlterTSConfigurationStmt(AlterTSConfigurationStmt *a,
1651+
AlterTSConfigurationStmt *b)
1652+
{
1653+
COMPARE_NODE_FIELD(cfgname);
1654+
COMPARE_NODE_FIELD(tokentype);
1655+
COMPARE_NODE_FIELD(dicts);
1656+
COMPARE_SCALAR_FIELD(override);
1657+
COMPARE_SCALAR_FIELD(replace);
1658+
COMPARE_SCALAR_FIELD(missing_ok);
1659+
1660+
return true;
1661+
}
1662+
16401663
static bool
16411664
_equalAExpr(A_Expr *a, A_Expr *b)
16421665
{
@@ -2415,10 +2438,15 @@ equal(void *a, void *b)
24152438
case T_DropOwnedStmt:
24162439
retval = _equalDropOwnedStmt(a, b);
24172440
break;
2418-
24192441
case T_ReassignOwnedStmt:
24202442
retval = _equalReassignOwnedStmt(a, b);
24212443
break;
2444+
case T_AlterTSDictionaryStmt:
2445+
retval = _equalAlterTSDictionaryStmt(a, b);
2446+
break;
2447+
case T_AlterTSConfigurationStmt:
2448+
retval = _equalAlterTSConfigurationStmt(a, b);
2449+
break;
24222450

24232451
case T_A_Expr:
24242452
retval = _equalAExpr(a, b);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy