Skip to content

Commit 39ac559

Browse files
committed
Reconcile nodes/*funcs.c with PostgreSQL 10 work.
The _equalTableFunc() omission of coltypmods has semantic significance, but I did not track down resulting user-visible bugs, if any. The other changes are cosmetic only, affecting order. catversion bump due to readfuncs.c field order change.
1 parent c254970 commit 39ac559

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

src/backend/nodes/copyfuncs.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,8 @@ _copyTableFunc(const TableFunc *from)
12221222
{
12231223
TableFunc *newnode = makeNode(TableFunc);
12241224

1225-
COPY_NODE_FIELD(ns_names);
12261225
COPY_NODE_FIELD(ns_uris);
1226+
COPY_NODE_FIELD(ns_names);
12271227
COPY_NODE_FIELD(docexpr);
12281228
COPY_NODE_FIELD(rowexpr);
12291229
COPY_NODE_FIELD(colnames);
@@ -4005,8 +4005,8 @@ _copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
40054005
COPY_STRING_FIELD(servertype);
40064006
COPY_STRING_FIELD(version);
40074007
COPY_STRING_FIELD(fdwname);
4008-
COPY_NODE_FIELD(options);
40094008
COPY_SCALAR_FIELD(if_not_exists);
4009+
COPY_NODE_FIELD(options);
40104010

40114011
return newnode;
40124012
}
@@ -4031,8 +4031,8 @@ _copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
40314031

40324032
COPY_NODE_FIELD(user);
40334033
COPY_STRING_FIELD(servername);
4034-
COPY_NODE_FIELD(options);
40354034
COPY_SCALAR_FIELD(if_not_exists);
4035+
COPY_NODE_FIELD(options);
40364036

40374037
return newnode;
40384038
}

src/backend/nodes/equalfuncs.c

+6-8
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ _equalRangeVar(const RangeVar *a, const RangeVar *b)
119119
static bool
120120
_equalTableFunc(const TableFunc *a, const TableFunc *b)
121121
{
122-
COMPARE_NODE_FIELD(ns_names);
123122
COMPARE_NODE_FIELD(ns_uris);
123+
COMPARE_NODE_FIELD(ns_names);
124124
COMPARE_NODE_FIELD(docexpr);
125125
COMPARE_NODE_FIELD(rowexpr);
126126
COMPARE_NODE_FIELD(colnames);
127127
COMPARE_NODE_FIELD(coltypes);
128-
COMPARE_NODE_FIELD(coltypes);
128+
COMPARE_NODE_FIELD(coltypmods);
129129
COMPARE_NODE_FIELD(colcollations);
130130
COMPARE_NODE_FIELD(colexprs);
131131
COMPARE_NODE_FIELD(coldefexprs);
@@ -1231,8 +1231,8 @@ _equalCreateStmt(const CreateStmt *a, const CreateStmt *b)
12311231
COMPARE_NODE_FIELD(relation);
12321232
COMPARE_NODE_FIELD(tableElts);
12331233
COMPARE_NODE_FIELD(inhRelations);
1234-
COMPARE_NODE_FIELD(partspec);
12351234
COMPARE_NODE_FIELD(partbound);
1235+
COMPARE_NODE_FIELD(partspec);
12361236
COMPARE_NODE_FIELD(ofTypename);
12371237
COMPARE_NODE_FIELD(constraints);
12381238
COMPARE_NODE_FIELD(options);
@@ -1869,8 +1869,8 @@ _equalCreateForeignServerStmt(const CreateForeignServerStmt *a, const CreateFore
18691869
COMPARE_STRING_FIELD(servertype);
18701870
COMPARE_STRING_FIELD(version);
18711871
COMPARE_STRING_FIELD(fdwname);
1872-
COMPARE_NODE_FIELD(options);
18731872
COMPARE_SCALAR_FIELD(if_not_exists);
1873+
COMPARE_NODE_FIELD(options);
18741874

18751875
return true;
18761876
}
@@ -1891,8 +1891,8 @@ _equalCreateUserMappingStmt(const CreateUserMappingStmt *a, const CreateUserMapp
18911891
{
18921892
COMPARE_NODE_FIELD(user);
18931893
COMPARE_STRING_FIELD(servername);
1894-
COMPARE_NODE_FIELD(options);
18951894
COMPARE_SCALAR_FIELD(if_not_exists);
1895+
COMPARE_NODE_FIELD(options);
18961896

18971897
return true;
18981898
}
@@ -2507,7 +2507,6 @@ _equalRangeTableFuncCol(const RangeTableFuncCol *a, const RangeTableFuncCol *b)
25072507
COMPARE_STRING_FIELD(colname);
25082508
COMPARE_NODE_FIELD(typeName);
25092509
COMPARE_SCALAR_FIELD(for_ordinality);
2510-
COMPARE_NODE_FIELD(typeName);
25112510
COMPARE_SCALAR_FIELD(is_not_null);
25122511
COMPARE_NODE_FIELD(colexpr);
25132512
COMPARE_NODE_FIELD(coldefexpr);
@@ -2605,7 +2604,6 @@ _equalLockingClause(const LockingClause *a, const LockingClause *b)
26052604
COMPARE_NODE_FIELD(lockedRels);
26062605
COMPARE_SCALAR_FIELD(strength);
26072606
COMPARE_SCALAR_FIELD(waitPolicy);
2608-
COMPARE_LOCATION_FIELD(location);
26092607

26102608
return true;
26112609
}
@@ -2622,8 +2620,8 @@ _equalRangeTblEntry(const RangeTblEntry *a, const RangeTblEntry *b)
26222620
COMPARE_SCALAR_FIELD(jointype);
26232621
COMPARE_NODE_FIELD(joinaliasvars);
26242622
COMPARE_NODE_FIELD(functions);
2625-
COMPARE_NODE_FIELD(tablefunc);
26262623
COMPARE_SCALAR_FIELD(funcordinality);
2624+
COMPARE_NODE_FIELD(tablefunc);
26272625
COMPARE_NODE_FIELD(values_lists);
26282626
COMPARE_STRING_FIELD(ctename);
26292627
COMPARE_SCALAR_FIELD(ctelevelsup);

src/backend/nodes/outfuncs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1018,8 +1018,8 @@ _outTableFunc(StringInfo str, const TableFunc *node)
10181018
{
10191019
WRITE_NODE_TYPE("TABLEFUNC");
10201020

1021-
WRITE_NODE_FIELD(ns_names);
10221021
WRITE_NODE_FIELD(ns_uris);
1022+
WRITE_NODE_FIELD(ns_names);
10231023
WRITE_NODE_FIELD(docexpr);
10241024
WRITE_NODE_FIELD(rowexpr);
10251025
WRITE_NODE_FIELD(colnames);

src/backend/nodes/readfuncs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,8 @@ _readTableFunc(void)
467467
{
468468
READ_LOCALS(TableFunc);
469469

470-
READ_NODE_FIELD(ns_names);
471470
READ_NODE_FIELD(ns_uris);
471+
READ_NODE_FIELD(ns_names);
472472
READ_NODE_FIELD(docexpr);
473473
READ_NODE_FIELD(rowexpr);
474474
READ_NODE_FIELD(colnames);

src/include/catalog/catversion.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 201706141
56+
#define CATALOG_VERSION_NO 201706161
5757

5858
#endif

0 commit comments

Comments
 (0)