@@ -75,6 +75,7 @@ flattenJsonPathParseItem(StringInfo buf, JsonPathParseItem *item,
7575 case jpiMul :
7676 case jpiDiv :
7777 case jpiMod :
78+ case jpiStartsWith :
7879 {
7980 int32 left , right ;
8081
@@ -265,6 +266,8 @@ printOperation(StringInfo buf, JsonPathItemType type)
265266 appendBinaryStringInfo (buf , " / " , 3 ); break ;
266267 case jpiMod :
267268 appendBinaryStringInfo (buf , " % " , 3 ); break ;
269+ case jpiStartsWith :
270+ appendBinaryStringInfo (buf , " starts with " , 13 ); break ;
268271 default :
269272 elog (ERROR , "Unknown jsonpath item type: %d" , type );
270273 }
@@ -285,6 +288,7 @@ operationPriority(JsonPathItemType op)
285288 case jpiGreater :
286289 case jpiLessOrEqual :
287290 case jpiGreaterOrEqual :
291+ case jpiStartsWith :
288292 return 2 ;
289293 case jpiAdd :
290294 case jpiSub :
@@ -350,6 +354,7 @@ printJsonPathItem(StringInfo buf, JsonPathItem *v, bool inKey, bool printBracket
350354 case jpiMul :
351355 case jpiDiv :
352356 case jpiMod :
357+ case jpiStartsWith :
353358 if (printBracketes )
354359 appendStringInfoChar (buf , '(' );
355360 jspGetLeftArg (v , & elem );
@@ -598,6 +603,7 @@ jspInitByBuffer(JsonPathItem *v, char *base, int32 pos)
598603 case jpiGreater :
599604 case jpiLessOrEqual :
600605 case jpiGreaterOrEqual :
606+ case jpiStartsWith :
601607 read_int32 (v -> content .args .left , base , pos );
602608 read_int32 (v -> content .args .right , base , pos );
603609 break ;
@@ -666,7 +672,8 @@ jspGetNext(JsonPathItem *v, JsonPathItem *a)
666672 v -> type == jpiCeiling ||
667673 v -> type == jpiDouble ||
668674 v -> type == jpiDatetime ||
669- v -> type == jpiKeyValue
675+ v -> type == jpiKeyValue ||
676+ v -> type == jpiStartsWith
670677 );
671678
672679 if (a )
@@ -693,7 +700,8 @@ jspGetLeftArg(JsonPathItem *v, JsonPathItem *a)
693700 v -> type == jpiSub ||
694701 v -> type == jpiMul ||
695702 v -> type == jpiDiv ||
696- v -> type == jpiMod
703+ v -> type == jpiMod ||
704+ v -> type == jpiStartsWith
697705 );
698706
699707 jspInitByBuffer (a , v -> base , v -> content .args .left );
@@ -715,7 +723,8 @@ jspGetRightArg(JsonPathItem *v, JsonPathItem *a)
715723 v -> type == jpiSub ||
716724 v -> type == jpiMul ||
717725 v -> type == jpiDiv ||
718- v -> type == jpiMod
726+ v -> type == jpiMod ||
727+ v -> type == jpiStartsWith
719728 );
720729
721730 jspInitByBuffer (a , v -> base , v -> content .args .right );
0 commit comments