diff options
| author | Tom Lane | 2022-05-13 15:40:01 +0000 |
|---|---|---|
| committer | Tom Lane | 2022-05-13 15:40:08 +0000 |
| commit | 3ab9a63cb638a1fd99475668e2da9c237495aeda (patch) | |
| tree | fac93993a8a296e02fd12a4b222887f0d6b7d38e /src/include/nodes | |
| parent | 2454cb07eed1ec7e68b9953b03d473d3c334ba05 (diff) | |
Rename JsonIsPredicate.value_type, fix JSON backend/nodes/ infrastructure.
I started out with the intention to rename value_type to item_type to
avoid a collision with a typedef name that appears on some platforms.
Along the way, I noticed that the adjacent field "format" was not being
correctly handled by the backend/nodes/ infrastructure functions:
copyfuncs.c erroneously treated it as a scalar, while equalfuncs,
outfuncs, and readfuncs omitted handling it at all. This looks like
it might be cosmetic at the moment because the field is always NULL
after parse analysis; but that's likely a bug in itself, and the code's
certainly not very future-proof. Let's fix it while we can still do so
without forcing an initdb on beta testers.
Further study found a few other inconsistencies in the backend/nodes/
infrastructure for the recently-added JSON node types, so fix those too.
catversion bumped because of potential change in stored rules.
Discussion: https://postgr.es/m/526703.1652385613@sss.pgh.pa.us
Diffstat (limited to 'src/include/nodes')
| -rw-r--r-- | src/include/nodes/makefuncs.h | 2 | ||||
| -rw-r--r-- | src/include/nodes/primnodes.h | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/include/nodes/makefuncs.h b/src/include/nodes/makefuncs.h index c717468eb39..06e6369026a 100644 --- a/src/include/nodes/makefuncs.h +++ b/src/include/nodes/makefuncs.h @@ -114,7 +114,7 @@ extern Node *makeJsonTableJoinedPlan(JsonTablePlanJoinType type, Node *plan1, Node *plan2, int location); extern Node *makeJsonKeyValue(Node *key, Node *value); extern Node *makeJsonIsPredicate(Node *expr, JsonFormat *format, - JsonValueType vtype, bool unique_keys, + JsonValueType item_type, bool unique_keys, int location); extern JsonEncoding makeJsonEncoding(char *name); diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index 66e179c4356..51505eee85d 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -1387,14 +1387,14 @@ typedef enum JsonValueType /* * JsonIsPredicate - - * untransformed representation of IS JSON predicate + * representation of IS JSON predicate */ typedef struct JsonIsPredicate { NodeTag type; - Node *expr; /* untransformed expression */ + Node *expr; /* subject expression */ JsonFormat *format; /* FORMAT clause, if specified */ - JsonValueType value_type; /* JSON item type */ + JsonValueType item_type; /* JSON item type */ bool unique_keys; /* check key uniqueness? */ int location; /* token location, or -1 if unknown */ } JsonIsPredicate; |
