{
bool first = true;
JsonbIterator *it;
- int type = 0;
+ JsonbIteratorToken type;
JsonbValue v;
int level = 0;
bool redo_switch = false;
first = false;
break;
default:
- elog(ERROR, "unknown flag of jsonb iterator");
+ elog(ERROR, "unknown jsonb iterator token type");
}
}
case JSONBTYPE_JSONB:
{
Jsonb *jsonb = DatumGetJsonb(val);
- int type;
+ JsonbIteratorToken type;
JsonbIterator *it;
it = JsonbIteratorInit(&jsonb->root);
JsonbIterator *it;
Jsonb *jbelem;
JsonbValue v;
- int type;
+ JsonbIteratorToken type;
if (val_type == InvalidOid)
ereport(ERROR,
case WJB_VALUE:
if (v.type == jbvString)
{
- /* copy string values in the aggreagate context */
+ /* copy string values in the aggregate context */
char *buf = palloc(v.val.string.len + 1);;
snprintf(buf, v.val.string.len + 1, "%s", v.val.string.val);
v.val.string.val = buf;
result->res = pushJsonbValue(&result->parseState,
type, &v);
break;
+ default:
+ elog(ERROR, "unknown jsonb iterator token type");
}
}
Jsonb *jbkey,
*jbval;
JsonbValue v;
- int type;
+ JsonbIteratorToken type;
if (!AggCheckCallContext(fcinfo, &aggcontext))
{
case WJB_ELEM:
if (v.type == jbvString)
{
- /* copy string values in the aggreagate context */
+ /* copy string values in the aggregate context */
char *buf = palloc(v.val.string.len + 1);;
snprintf(buf, v.val.string.len + 1, "%s", v.val.string.val);
v.val.string.val = buf;
case WJB_VALUE:
if (v.type == jbvString)
{
- /* copy string values in the aggreagate context */
+ /* copy string values in the aggregate context */
char *buf = palloc(v.val.string.len + 1);;
snprintf(buf, v.val.string.len + 1, "%s", v.val.string.val);
v.val.string.val = buf;
single_scalar ? WJB_VALUE : type,
&v);
break;
+ default:
+ elog(ERROR, "unknown jsonb iterator token type");
}
}