index 8fef35ea38a53c94082b8e7ca4382707ccc758a9..8b1cab488bb80bbce8e2c99aef4aa29a9df76f34 100644 (file)
@@ -455,8 +455,8 @@ JsonbToCStringWorker(StringInfo out, JsonbContainer *in, int estimated_len, bool
{
bool first = true;
JsonbIterator *it;
- JsonbIteratorToken type = WJB_DONE;
JsonbValue v;
+ JsonbIteratorToken type = WJB_DONE;
int level = 0;
bool redo_switch = false;
@@ -899,7 +899,6 @@ datum_to_jsonb(Datum val, bool is_null, JsonbInState *result,
case JSONBTYPE_JSONB:
{
Jsonb *jsonb = DatumGetJsonb(val);
- JsonbIteratorToken type;
JsonbIterator *it;
it = JsonbIteratorInit(&jsonb->root);
@@ -913,6 +912,8 @@ datum_to_jsonb(Datum val, bool is_null, JsonbInState *result,
}
else
{
+ JsonbIteratorToken type;
+
while ((type = JsonbIteratorNext(&it, &jb, false))
!= WJB_DONE)
{
index 2591c81f3d67151ba34953518a92108b46825c14..204fb8b5919c34dd73d1de0218571981fa9f8668 100644 (file)
@@ -70,8 +70,8 @@ gin_extract_jsonb(PG_FUNCTION_ARGS)
int total = 2 * JB_ROOT_COUNT(jb);
JsonbIterator *it;
JsonbValue v;
- int i = 0,
- r;
+ JsonbIteratorToken r;
+ int i = 0;
Datum *entries;
/* If the root level is empty, we certainly have no keys */
int total = 2 * JB_ROOT_COUNT(jb);
JsonbIterator *it;
JsonbValue v;
+ JsonbIteratorToken r;
PathHashStack tail;
PathHashStack *stack;
- int i = 0,
- r;
+ int i = 0;
Datum *entries;
/* If the root level is empty, we certainly have no keys */
@@ -429,7 +429,7 @@ gin_extract_jsonb_path(PG_FUNCTION_ARGS)
stack = parent;
break;
default:
- elog(ERROR, "invalid JsonbIteratorNext rc: %d", r);
+ elog(ERROR, "invalid JsonbIteratorNext rc: %d", (int) r);
}
}
index f33864e619dca5f605aedbdb3e24d17bbb23b718..222acd7afb7118b115d3d6de18ad3251103cc1d6 100644 (file)
bool skipNested = false;
JsonbIterator *it;
JsonbValue v;
- int r;
+ JsonbIteratorToken r;
if (JB_ROOT_IS_SCALAR(jb))
ereport(ERROR,
@@ -1283,7 +1283,7 @@ get_jsonb_path_all(FunctionCallInfo fcinfo, bool as_text)
if (jbvp->type == jbvBinary)
{
JsonbIterator *it = JsonbIteratorInit((JsonbContainer *) jbvp->val.binary.data);
- int r;
+ JsonbIteratorToken r;
r = JsonbIteratorNext(&it, &tv, true);
container = (JsonbContainer *) jbvp->val.binary.data;
@@ -1456,7 +1456,7 @@ each_worker_jsonb(FunctionCallInfo fcinfo, const char *funcname, bool as_text)
bool skipNested = false;
JsonbIterator *it;
JsonbValue v;
- int r;
+ JsonbIteratorToken r;
if (!JB_ROOT_IS_OBJECT(jb))
ereport(ERROR,
@@ -1775,7 +1775,7 @@ elements_worker_jsonb(FunctionCallInfo fcinfo, const char *funcname,
bool skipNested = false;
JsonbIterator *it;
JsonbValue v;
- int r;
+ JsonbIteratorToken r;
if (JB_ROOT_IS_SCALAR(jb))
ereport(ERROR,
@@ -2792,7 +2792,7 @@ populate_recordset_worker(FunctionCallInfo fcinfo, const char *funcname,
JsonbIterator *it;
JsonbValue v;
bool skipNested = false;
- int r;
+ JsonbIteratorToken r;
Assert(jtype == JSONBOID);
JsonbIterator *it;
JsonbParseState *parseState = NULL;
JsonbValue *res = NULL;
- int type;
JsonbValue v,
k;
+ JsonbIteratorToken type;
bool last_was_key = false;
if (JB_ROOT_IS_SCALAR(jb))
@@ -3290,8 +3290,8 @@ addJsonbToParseState(JsonbParseState **jbps, Jsonb *jb)
{
JsonbIterator *it;
JsonbValue *o = &(*jbps)->contVal;
- int type;
JsonbValue v;
+ JsonbIteratorToken type;
it = JsonbIteratorInit(&jb->root);
int keylen = VARSIZE_ANY_EXHDR(key);
JsonbParseState *state = NULL;
JsonbIterator *it;
- uint32 r;
JsonbValue v,
*res = NULL;
bool skipNested = false;
+ JsonbIteratorToken r;
if (JB_ROOT_IS_SCALAR(in))
ereport(ERROR,
int idx = PG_GETARG_INT32(1);
JsonbParseState *state = NULL;
JsonbIterator *it;
- uint32 r,
- i = 0,
+ uint32 i = 0,
n;
JsonbValue v,
*res = NULL;
+ JsonbIteratorToken r;
if (JB_ROOT_IS_SCALAR(in))
ereport(ERROR,
IteratorConcat(JsonbIterator **it1, JsonbIterator **it2,
JsonbParseState **state)
{
- uint32 r1,
- r2,
- rk1,
- rk2;
JsonbValue v1,
v2,
*res = NULL;
+ JsonbIteratorToken r1,
+ r2,
+ rk1,
+ rk2;
r1 = rk1 = JsonbIteratorNext(it1, &v1, false);
r2 = rk2 = JsonbIteratorNext(it2, &v2, false);
JsonbParseState **st, int level, Jsonb *newval, bool create)
{
JsonbValue v;
+ JsonbIteratorToken r;
JsonbValue *res = NULL;
- int r;
check_stack_depth();
@@ -3793,7 +3793,7 @@ setPathObject(JsonbIterator **it, Datum *path_elems, bool *path_nulls,
for (i = 0; i < npairs; i++)
{
- int r = JsonbIteratorNext(it, &k, true);
+ JsonbIteratorToken r = JsonbIteratorNext(it, &k, true);
Assert(r == WJB_KEY);
@@ -3914,7 +3914,7 @@ setPathArray(JsonbIterator **it, Datum *path_elems, bool *path_nulls,
/* iterate over the array elements */
for (i = 0; i < nelems; i++)
{
- int r;
+ JsonbIteratorToken r;
if (i == idx && level < path_len)
{