@@ -351,30 +351,30 @@ printJsonPathItem(StringInfo buf, JsonPathItem *v, bool inKey, bool printBracket
351
351
break ;
352
352
case jpiIndexArray :
353
353
appendStringInfoChar (buf , '[' );
354
- for (i = 0 ; i < v -> array .nelems ; i ++ )
354
+ for (i = 0 ; i < v -> content . array .nelems ; i ++ )
355
355
{
356
356
if (i )
357
357
appendStringInfoChar (buf , ',' );
358
- appendStringInfo (buf , "%d" , v -> array .elems [i ]);
358
+ appendStringInfo (buf , "%d" , v -> content . array .elems [i ]);
359
359
}
360
360
appendStringInfoChar (buf , ']' );
361
361
break ;
362
362
case jpiAny :
363
363
if (inKey )
364
364
appendStringInfoChar (buf , '.' );
365
365
366
- if (v -> anybounds .first == 0 &&
367
- v -> anybounds .last == PG_UINT32_MAX )
366
+ if (v -> content . anybounds .first == 0 &&
367
+ v -> content . anybounds .last == PG_UINT32_MAX )
368
368
appendBinaryStringInfo (buf , "**" , 2 );
369
- else if (v -> anybounds .first == 0 )
370
- appendStringInfo (buf , "**{,%u}" , v -> anybounds .last );
371
- else if (v -> anybounds .last == PG_UINT32_MAX )
372
- appendStringInfo (buf , "**{%u,}" , v -> anybounds .first );
373
- else if (v -> anybounds .first == v -> anybounds .last )
374
- appendStringInfo (buf , "**{%u}" , v -> anybounds .first );
369
+ else if (v -> content . anybounds .first == 0 )
370
+ appendStringInfo (buf , "**{,%u}" , v -> content . anybounds .last );
371
+ else if (v -> content . anybounds .last == PG_UINT32_MAX )
372
+ appendStringInfo (buf , "**{%u,}" , v -> content . anybounds .first );
373
+ else if (v -> content . anybounds .first == v -> content . anybounds .last )
374
+ appendStringInfo (buf , "**{%u}" , v -> content . anybounds .first );
375
375
else
376
- appendStringInfo (buf , "**{%u,%u}" , v -> anybounds .first ,
377
- v -> anybounds .last );
376
+ appendStringInfo (buf , "**{%u,%u}" , v -> content . anybounds .first ,
377
+ v -> content . anybounds .last );
378
378
break ;
379
379
default :
380
380
elog (ERROR , "Unknown jsonpath item type: %d" , v -> type );
@@ -452,11 +452,11 @@ jspInitByBuffer(JsonPathItem *v, char *base, int32 pos)
452
452
case jpiKey :
453
453
case jpiString :
454
454
case jpiVariable :
455
- read_int32 (v -> value .datalen , base , pos );
455
+ read_int32 (v -> content . value .datalen , base , pos );
456
456
/* follow next */
457
457
case jpiNumeric :
458
458
case jpiBool :
459
- v -> value .data = base + pos ;
459
+ v -> content . value .data = base + pos ;
460
460
break ;
461
461
case jpiAnd :
462
462
case jpiOr :
@@ -471,24 +471,24 @@ jspInitByBuffer(JsonPathItem *v, char *base, int32 pos)
471
471
case jpiGreater :
472
472
case jpiLessOrEqual :
473
473
case jpiGreaterOrEqual :
474
- read_int32 (v -> args .left , base , pos );
475
- read_int32 (v -> args .right , base , pos );
474
+ read_int32 (v -> content . args .left , base , pos );
475
+ read_int32 (v -> content . args .right , base , pos );
476
476
break ;
477
477
case jpiNot :
478
478
case jpiExists :
479
479
case jpiIsUnknown :
480
480
case jpiPlus :
481
481
case jpiMinus :
482
482
case jpiFilter :
483
- read_int32 (v -> arg , base , pos );
483
+ read_int32 (v -> content . arg , base , pos );
484
484
break ;
485
485
case jpiIndexArray :
486
- read_int32 (v -> array .nelems , base , pos );
487
- read_int32_n (v -> array .elems , base , pos , v -> array .nelems );
486
+ read_int32 (v -> content . array .nelems , base , pos );
487
+ read_int32_n (v -> content . array .elems , base , pos , v -> content . array .nelems );
488
488
break ;
489
489
case jpiAny :
490
- read_int32 (v -> anybounds .first , base , pos );
491
- read_int32 (v -> anybounds .last , base , pos );
490
+ read_int32 (v -> content . anybounds .first , base , pos );
491
+ read_int32 (v -> content . anybounds .last , base , pos );
492
492
break ;
493
493
default :
494
494
elog (ERROR , "Unknown jsonpath item type: %d" , v -> type );
@@ -507,7 +507,7 @@ jspGetArg(JsonPathItem *v, JsonPathItem *a)
507
507
v -> type == jpiMinus
508
508
);
509
509
510
- jspInitByBuffer (a , v -> base , v -> arg );
510
+ jspInitByBuffer (a , v -> base , v -> content . arg );
511
511
}
512
512
513
513
bool
@@ -554,7 +554,7 @@ jspGetLeftArg(JsonPathItem *v, JsonPathItem *a)
554
554
v -> type == jpiMod
555
555
);
556
556
557
- jspInitByBuffer (a , v -> base , v -> args .left );
557
+ jspInitByBuffer (a , v -> base , v -> content . args .left );
558
558
}
559
559
560
560
void
@@ -576,23 +576,23 @@ jspGetRightArg(JsonPathItem *v, JsonPathItem *a)
576
576
v -> type == jpiMod
577
577
);
578
578
579
- jspInitByBuffer (a , v -> base , v -> args .right );
579
+ jspInitByBuffer (a , v -> base , v -> content . args .right );
580
580
}
581
581
582
582
bool
583
583
jspGetBool (JsonPathItem * v )
584
584
{
585
585
Assert (v -> type == jpiBool );
586
586
587
- return (bool )* v -> value .data ;
587
+ return (bool )* v -> content . value .data ;
588
588
}
589
589
590
590
Numeric
591
591
jspGetNumeric (JsonPathItem * v )
592
592
{
593
593
Assert (v -> type == jpiNumeric );
594
594
595
- return (Numeric )v -> value .data ;
595
+ return (Numeric )v -> content . value .data ;
596
596
}
597
597
598
598
char *
@@ -605,6 +605,6 @@ jspGetString(JsonPathItem *v, int32 *len)
605
605
);
606
606
607
607
if (len )
608
- * len = v -> value .datalen ;
609
- return v -> value .data ;
608
+ * len = v -> content . value .datalen ;
609
+ return v -> content . value .data ;
610
610
}
0 commit comments