Commit 50ab76d3 authored by Andrew Dunstan's avatar Andrew Dunstan

Avoid naming a variable "new", and remove bogus initializer.

Per gripe from Tom Lane.
parent 28b29f7e
...@@ -3716,13 +3716,13 @@ setPathObject(JsonbIterator **it, Datum *path_elems, bool *path_nulls, ...@@ -3716,13 +3716,13 @@ setPathObject(JsonbIterator **it, Datum *path_elems, bool *path_nulls,
/* empty object is a special case for create */ /* empty object is a special case for create */
if ((npairs == 0) && create && (level == path_len - 1)) if ((npairs == 0) && create && (level == path_len - 1))
{ {
JsonbValue new = k; JsonbValue newkey;
new.type = jbvString; newkey.type = jbvString;
new.val.string.len = VARSIZE_ANY_EXHDR(path_elems[level]); newkey.val.string.len = VARSIZE_ANY_EXHDR(path_elems[level]);
new.val.string.val = VARDATA_ANY(path_elems[level]); newkey.val.string.val = VARDATA_ANY(path_elems[level]);
(void) pushJsonbValue(st, WJB_KEY, &new); (void) pushJsonbValue(st, WJB_KEY, &newkey);
addJsonbToParseState(st, newval); addJsonbToParseState(st, newval);
} }
...@@ -3758,13 +3758,13 @@ setPathObject(JsonbIterator **it, Datum *path_elems, bool *path_nulls, ...@@ -3758,13 +3758,13 @@ setPathObject(JsonbIterator **it, Datum *path_elems, bool *path_nulls,
{ {
if (create && !done && level == path_len - 1 && i == npairs - 1) if (create && !done && level == path_len - 1 && i == npairs - 1)
{ {
JsonbValue new = k; JsonbValue newkey;
new.type = jbvString; newkey.type = jbvString;
new.val.string.len = VARSIZE_ANY_EXHDR(path_elems[level]); newkey.val.string.len = VARSIZE_ANY_EXHDR(path_elems[level]);
new.val.string.val = VARDATA_ANY(path_elems[level]); newkey.val.string.val = VARDATA_ANY(path_elems[level]);
(void) pushJsonbValue(st, WJB_KEY, &new); (void) pushJsonbValue(st, WJB_KEY, &newkey);
addJsonbToParseState(st, newval); addJsonbToParseState(st, newval);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment