@@ -357,30 +357,30 @@ printJsonPathItem(StringInfo buf, JsonPathItem *v, bool inKey, bool printBracket
357
357
break ;
358
358
case jpiIndexArray :
359
359
appendStringInfoChar (buf , '[' );
360
- for (i = 0 ; i < v -> array .nelems ; i ++ )
360
+ for (i = 0 ; i < v -> content . array .nelems ; i ++ )
361
361
{
362
362
if (i )
363
363
appendStringInfoChar (buf , ',' );
364
- appendStringInfo (buf , "%d" , v -> array .elems [i ]);
364
+ appendStringInfo (buf , "%d" , v -> content . array .elems [i ]);
365
365
}
366
366
appendStringInfoChar (buf , ']' );
367
367
break ;
368
368
case jpiAny :
369
369
if (inKey )
370
370
appendStringInfoChar (buf , '.' );
371
371
372
- if (v -> anybounds .first == 0 &&
373
- v -> anybounds .last == PG_UINT32_MAX )
372
+ if (v -> content . anybounds .first == 0 &&
373
+ v -> content . anybounds .last == PG_UINT32_MAX )
374
374
appendBinaryStringInfo (buf , "**" , 2 );
375
- else if (v -> anybounds .first == 0 )
376
- appendStringInfo (buf , "**{,%u}" , v -> anybounds .last );
377
- else if (v -> anybounds .last == PG_UINT32_MAX )
378
- appendStringInfo (buf , "**{%u,}" , v -> anybounds .first );
379
- else if (v -> anybounds .first == v -> anybounds .last )
380
- appendStringInfo (buf , "**{%u}" , v -> anybounds .first );
375
+ else if (v -> content . anybounds .first == 0 )
376
+ appendStringInfo (buf , "**{,%u}" , v -> content . anybounds .last );
377
+ else if (v -> content . anybounds .last == PG_UINT32_MAX )
378
+ appendStringInfo (buf , "**{%u,}" , v -> content . anybounds .first );
379
+ else if (v -> content . anybounds .first == v -> content . anybounds .last )
380
+ appendStringInfo (buf , "**{%u}" , v -> content . anybounds .first );
381
381
else
382
- appendStringInfo (buf , "**{%u,%u}" , v -> anybounds .first ,
383
- v -> anybounds .last );
382
+ appendStringInfo (buf , "**{%u,%u}" , v -> content . anybounds .first ,
383
+ v -> content . anybounds .last );
384
384
break ;
385
385
default :
386
386
elog (ERROR , "Unknown jsonpath item type: %d" , v -> type );
@@ -458,11 +458,11 @@ jspInitByBuffer(JsonPathItem *v, char *base, int32 pos)
458
458
case jpiKey :
459
459
case jpiString :
460
460
case jpiVariable :
461
- read_int32 (v -> value .datalen , base , pos );
461
+ read_int32 (v -> content . value .datalen , base , pos );
462
462
/* follow next */
463
463
case jpiNumeric :
464
464
case jpiBool :
465
- v -> value .data = base + pos ;
465
+ v -> content . value .data = base + pos ;
466
466
break ;
467
467
case jpiAnd :
468
468
case jpiOr :
@@ -477,24 +477,24 @@ jspInitByBuffer(JsonPathItem *v, char *base, int32 pos)
477
477
case jpiGreater :
478
478
case jpiLessOrEqual :
479
479
case jpiGreaterOrEqual :
480
- read_int32 (v -> args .left , base , pos );
481
- read_int32 (v -> args .right , base , pos );
480
+ read_int32 (v -> content . args .left , base , pos );
481
+ read_int32 (v -> content . args .right , base , pos );
482
482
break ;
483
483
case jpiNot :
484
484
case jpiExists :
485
485
case jpiIsUnknown :
486
486
case jpiPlus :
487
487
case jpiMinus :
488
488
case jpiFilter :
489
- read_int32 (v -> arg , base , pos );
489
+ read_int32 (v -> content . arg , base , pos );
490
490
break ;
491
491
case jpiIndexArray :
492
- read_int32 (v -> array .nelems , base , pos );
493
- read_int32_n (v -> array .elems , base , pos , v -> array .nelems );
492
+ read_int32 (v -> content . array .nelems , base , pos );
493
+ read_int32_n (v -> content . array .elems , base , pos , v -> content . array .nelems );
494
494
break ;
495
495
case jpiAny :
496
- read_int32 (v -> anybounds .first , base , pos );
497
- read_int32 (v -> anybounds .last , base , pos );
496
+ read_int32 (v -> content . anybounds .first , base , pos );
497
+ read_int32 (v -> content . anybounds .last , base , pos );
498
498
break ;
499
499
default :
500
500
elog (ERROR , "Unknown jsonpath item type: %d" , v -> type );
@@ -513,7 +513,7 @@ jspGetArg(JsonPathItem *v, JsonPathItem *a)
513
513
v -> type == jpiMinus
514
514
);
515
515
516
- jspInitByBuffer (a , v -> base , v -> arg );
516
+ jspInitByBuffer (a , v -> base , v -> content . arg );
517
517
}
518
518
519
519
bool
@@ -560,7 +560,7 @@ jspGetLeftArg(JsonPathItem *v, JsonPathItem *a)
560
560
v -> type == jpiMod
561
561
);
562
562
563
- jspInitByBuffer (a , v -> base , v -> args .left );
563
+ jspInitByBuffer (a , v -> base , v -> content . args .left );
564
564
}
565
565
566
566
void
@@ -582,23 +582,23 @@ jspGetRightArg(JsonPathItem *v, JsonPathItem *a)
582
582
v -> type == jpiMod
583
583
);
584
584
585
- jspInitByBuffer (a , v -> base , v -> args .right );
585
+ jspInitByBuffer (a , v -> base , v -> content . args .right );
586
586
}
587
587
588
588
bool
589
589
jspGetBool (JsonPathItem * v )
590
590
{
591
591
Assert (v -> type == jpiBool );
592
592
593
- return (bool )* v -> value .data ;
593
+ return (bool )* v -> content . value .data ;
594
594
}
595
595
596
596
Numeric
597
597
jspGetNumeric (JsonPathItem * v )
598
598
{
599
599
Assert (v -> type == jpiNumeric );
600
600
601
- return (Numeric )v -> value .data ;
601
+ return (Numeric )v -> content . value .data ;
602
602
}
603
603
604
604
char *
@@ -611,6 +611,6 @@ jspGetString(JsonPathItem *v, int32 *len)
611
611
);
612
612
613
613
if (len )
614
- * len = v -> value .datalen ;
615
- return v -> value .data ;
614
+ * len = v -> content . value .datalen ;
615
+ return v -> content . value .data ;
616
616
}
0 commit comments