aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/jsonb.h
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2015-05-22 10:21:41 -0400
committerAndrew Dunstan <andrew@dunslane.net>2015-05-22 10:21:41 -0400
commit5302760a50332a684e35b9865ff47ff5fd4970c2 (patch)
tree35e0a5c42e1cd1530ef599589105a434125e03a8 /src/include/utils/jsonb.h
parent6d1733fa90a3f8037c7c815ed6ab4d97c295e525 (diff)
downloadpostgresql-5302760a50332a684e35b9865ff47ff5fd4970c2.tar.gz
postgresql-5302760a50332a684e35b9865ff47ff5fd4970c2.zip
Unpack jbvBinary objects passed to pushJsonbValue
pushJsonbValue was accepting jbvBinary objects passed as WJB_ELEM or WJB_VALUE data. While this succeeded, when those objects were later encountered in attempting to convert the result to Jsonb, errors occurred. With this change we ghuarantee that a JSonbValue constructed from calls to pushJsonbValue does not contain any jbvBinary objects. This cures a problem observed with jsonb_delete. This means callers of pushJsonbValue no longer need to perform this unpacking themselves. A subsequent patch will perform some cleanup in that area. The error was not triggered by any 9.4 code, but this is a publicly visible routine, and so the error could be exercised by third party code, therefore backpatch to 9.4. Bug report from Peter Geoghegan, fix by me.
Diffstat (limited to 'src/include/utils/jsonb.h')
-rw-r--r--src/include/utils/jsonb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/utils/jsonb.h b/src/include/utils/jsonb.h
index 7b561759f7f..b02934a1aef 100644
--- a/src/include/utils/jsonb.h
+++ b/src/include/utils/jsonb.h
@@ -418,7 +418,7 @@ extern JsonbValue *findJsonbValueFromContainer(JsonbContainer *sheader,
extern JsonbValue *getIthJsonbValueFromContainer(JsonbContainer *sheader,
uint32 i);
extern JsonbValue *pushJsonbValue(JsonbParseState **pstate,
- JsonbIteratorToken seq, JsonbValue *scalarVal);
+ JsonbIteratorToken seq, JsonbValue *jbVal);
extern JsonbIterator *JsonbIteratorInit(JsonbContainer *container);
extern JsonbIteratorToken JsonbIteratorNext(JsonbIterator **it, JsonbValue *val,
bool skipNested);