1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-09 22:41:56 +03:00

Fix omission of locations in outfuncs/readfuncs partitioning node support.

We could have limped along without this for v10, which was my intention
when I annotated the bug in commit 76a3df6e5.  But consensus is that it's
better to fix it now and take the cost of a post-beta1 initdb (which is
needed because these node types are stored in pg_class.relpartbound).

Since we're forcing initdb anyway, take the opportunity to make the node
type identification strings match the node struct names, instead of being
randomly different from them.

Discussion: https://postgr.es/m/E1dFBEX-0004wt-8t@gemulon.postgresql.org
This commit is contained in:
Tom Lane
2017-05-30 11:32:41 -04:00
parent d5cb3bab56
commit 80f583ffe9
3 changed files with 10 additions and 12 deletions

View File

@ -2376,8 +2376,7 @@ _readPartitionBoundSpec(void)
READ_NODE_FIELD(listdatums);
READ_NODE_FIELD(lowerdatums);
READ_NODE_FIELD(upperdatums);
/* XXX somebody forgot location field; too late to change for v10 */
local_node->location = -1;
READ_LOCATION_FIELD(location);
READ_DONE();
}
@ -2392,8 +2391,7 @@ _readPartitionRangeDatum(void)
READ_BOOL_FIELD(infinite);
READ_NODE_FIELD(value);
/* XXX somebody forgot location field; too late to change for v10 */
local_node->location = -1;
READ_LOCATION_FIELD(location);
READ_DONE();
}
@ -2638,9 +2636,9 @@ parseNodeString(void)
return_value = _readAlternativeSubPlan();
else if (MATCH("EXTENSIBLENODE", 14))
return_value = _readExtensibleNode();
else if (MATCH("PARTITIONBOUND", 14))
else if (MATCH("PARTITIONBOUNDSPEC", 18))
return_value = _readPartitionBoundSpec();
else if (MATCH("PARTRANGEDATUM", 14))
else if (MATCH("PARTITIONRANGEDATUM", 19))
return_value = _readPartitionRangeDatum();
else
{