aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2024-01-25 16:21:57 -0500
committerAndrew Dunstan <andrew@dunslane.net>2024-01-25 16:25:11 -0500
commit06a66d87dbc7e06581af6765131ea250063fb4ac (patch)
tree060afe89594700cb1748a0881374b31360d58d21
parent7014c9a4bba2d1b67d60687afb5b2091c1d07f73 (diff)
downloadpostgresql-06a66d87dbc7e06581af6765131ea250063fb4ac.tar.gz
postgresql-06a66d87dbc7e06581af6765131ea250063fb4ac.zip
Clean up a bug in sql/json items commit 66ea94e8e6
Remove a buggy and unnecessary test, along with an unnecessary pstrdup() and a line of dead code. Per report, diagnosis and fix from Tom Lane Discussion: https://postgr.es/m/439811.1706211069@sss.pgh.pa.us
-rw-r--r--src/backend/utils/adt/jsonpath_exec.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index bf37f0195c8..02a700292bb 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -1540,11 +1540,9 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
break;
}
- res = jperOk;
-
jb = &jbv;
Assert(tmp != NULL); /* We must have set tmp above */
- jb->val.string.val = (jb->type == jbvString) ? tmp : pstrdup(tmp);
+ jb->val.string.val = tmp;
jb->val.string.len = strlen(jb->val.string.val);
jb->type = jbvString;