We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48a2cd3 commit e75feb2Copy full SHA for e75feb2
src/backend/utils/adt/jsonfuncs.c
@@ -682,9 +682,13 @@ get_array_start(void *state)
682
ereport(ERROR,
683
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
684
errmsg("cannot extract field from a non-object")));
685
- /* initialize array count for this nesting level */
+ /*
686
+ * initialize array count for this nesting level
687
+ * Note: the lex_level seen by array_start is one less than that seen by
688
+ * the elements of the array.
689
+ */
690
if (_state->search_type == JSON_SEARCH_PATH &&
- lex_level <= _state->npath)
691
+ lex_level < _state->npath)
692
_state->array_level_index[lex_level] = -1;
693
}
694
0 commit comments