@@ -424,7 +424,7 @@ JsonbToCString(StringInfo out, JsonbContainer *in, int estimated_len)
424
424
{
425
425
bool first = true;
426
426
JsonbIterator * it ;
427
- int type = 0 ;
427
+ JsonbIteratorToken type ;
428
428
JsonbValue v ;
429
429
int level = 0 ;
430
430
bool redo_switch = false;
@@ -506,7 +506,7 @@ JsonbToCString(StringInfo out, JsonbContainer *in, int estimated_len)
506
506
first = false;
507
507
break ;
508
508
default :
509
- elog (ERROR , "unknown flag of jsonb iterator" );
509
+ elog (ERROR , "unknown jsonb iterator token type " );
510
510
}
511
511
}
512
512
@@ -824,7 +824,7 @@ datum_to_jsonb(Datum val, bool is_null, JsonbInState *result,
824
824
case JSONBTYPE_JSONB :
825
825
{
826
826
Jsonb * jsonb = DatumGetJsonb (val );
827
- int type ;
827
+ JsonbIteratorToken type ;
828
828
JsonbIterator * it ;
829
829
830
830
it = JsonbIteratorInit (& jsonb -> root );
@@ -1519,7 +1519,7 @@ jsonb_agg_transfn(PG_FUNCTION_ARGS)
1519
1519
JsonbIterator * it ;
1520
1520
Jsonb * jbelem ;
1521
1521
JsonbValue v ;
1522
- int type ;
1522
+ JsonbIteratorToken type ;
1523
1523
1524
1524
if (val_type == InvalidOid )
1525
1525
ereport (ERROR ,
@@ -1591,7 +1591,7 @@ jsonb_agg_transfn(PG_FUNCTION_ARGS)
1591
1591
case WJB_VALUE :
1592
1592
if (v .type == jbvString )
1593
1593
{
1594
- /* copy string values in the aggreagate context */
1594
+ /* copy string values in the aggregate context */
1595
1595
char * buf = palloc (v .val .string .len + 1 );;
1596
1596
snprintf (buf , v .val .string .len + 1 , "%s" , v .val .string .val );
1597
1597
v .val .string .val = buf ;
@@ -1607,6 +1607,8 @@ jsonb_agg_transfn(PG_FUNCTION_ARGS)
1607
1607
result -> res = pushJsonbValue (& result -> parseState ,
1608
1608
type , & v );
1609
1609
break ;
1610
+ default :
1611
+ elog (ERROR , "unknown jsonb iterator token type" );
1610
1612
}
1611
1613
}
1612
1614
@@ -1667,7 +1669,7 @@ jsonb_object_agg_transfn(PG_FUNCTION_ARGS)
1667
1669
Jsonb * jbkey ,
1668
1670
* jbval ;
1669
1671
JsonbValue v ;
1670
- int type ;
1672
+ JsonbIteratorToken type ;
1671
1673
1672
1674
if (!AggCheckCallContext (fcinfo , & aggcontext ))
1673
1675
{
@@ -1750,7 +1752,7 @@ jsonb_object_agg_transfn(PG_FUNCTION_ARGS)
1750
1752
case WJB_ELEM :
1751
1753
if (v .type == jbvString )
1752
1754
{
1753
- /* copy string values in the aggreagate context */
1755
+ /* copy string values in the aggregate context */
1754
1756
char * buf = palloc (v .val .string .len + 1 );;
1755
1757
snprintf (buf , v .val .string .len + 1 , "%s" , v .val .string .val );
1756
1758
v .val .string .val = buf ;
@@ -1808,7 +1810,7 @@ jsonb_object_agg_transfn(PG_FUNCTION_ARGS)
1808
1810
case WJB_VALUE :
1809
1811
if (v .type == jbvString )
1810
1812
{
1811
- /* copy string values in the aggreagate context */
1813
+ /* copy string values in the aggregate context */
1812
1814
char * buf = palloc (v .val .string .len + 1 );;
1813
1815
snprintf (buf , v .val .string .len + 1 , "%s" , v .val .string .val );
1814
1816
v .val .string .val = buf ;
@@ -1825,6 +1827,8 @@ jsonb_object_agg_transfn(PG_FUNCTION_ARGS)
1825
1827
single_scalar ? WJB_VALUE : type ,
1826
1828
& v );
1827
1829
break ;
1830
+ default :
1831
+ elog (ERROR , "unknown jsonb iterator token type" );
1828
1832
}
1829
1833
}
1830
1834
0 commit comments