Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit eacc7a4

Browse files
author
Nikita Glukhov
committed
Fix jsonPathStatsGetNextSubpathStats()
1 parent 27a64b7 commit eacc7a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/jsonb_selfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ jsonPathStatsGetNextSubpathStats(JsonPathStats stats, JsonPathStats *pkeystats,
570570
else if (*c == '.')
571571
{
572572
/* find end of '."key"' */
573-
const char *pathend = path + pathlen;
573+
const char *pathend = path + pathlen - 1;
574574

575575
if (++c >= pathend || *c != '"')
576576
break; /* invalid path */
@@ -591,7 +591,7 @@ jsonPathStatsGetNextSubpathStats(JsonPathStats stats, JsonPathStats *pkeystats,
591591
}
592592

593593
/* Init path stats if needed */
594-
if (!stats->data)
594+
if (!keystats->data)
595595
{
596596
keystats->data = stats->data;
597597
keystats->datum = pathdatum;

0 commit comments

Comments
 (0)