Skip to content

Commit 2cf875a

Browse files
committed
Remove %error-verbose directive from jsonpath parser
None of the other bison parsers contains this directive, and it gives rise to some unfortunate and impenetrable messages, so just remove it. Backpatch to release 12, where it was introduced. Per gripe from Erik Rijkers Discussion: https://postgr.es/m/ba069ce2-a98f-dc70-dc17-2ccf2a9bf7c7@xs4all.nl
1 parent a424013 commit 2cf875a

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/backend/utils/adt/jsonpath_gram.y

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ static JsonPathParseItem *makeItemLikeRegex(JsonPathParseItem *expr,
7474
%pure-parser
7575
%expect 0
7676
%name-prefix="jsonpath_yy"
77-
%error-verbose
7877
%parse-param {JsonPathParseResult **result}
7978

8079
%union {

src/test/regress/expected/jsonpath.out

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -557,15 +557,15 @@ select '$ ? (@.a < +1)'::jsonpath;
557557
(1 row)
558558

559559
select '$ ? (@.a < .1)'::jsonpath;
560-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
560+
ERROR: syntax error at or near "." of jsonpath input
561561
LINE 1: select '$ ? (@.a < .1)'::jsonpath;
562562
^
563563
select '$ ? (@.a < -.1)'::jsonpath;
564-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
564+
ERROR: syntax error at or near "." of jsonpath input
565565
LINE 1: select '$ ? (@.a < -.1)'::jsonpath;
566566
^
567567
select '$ ? (@.a < +.1)'::jsonpath;
568-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
568+
ERROR: syntax error at or near "." of jsonpath input
569569
LINE 1: select '$ ? (@.a < +.1)'::jsonpath;
570570
^
571571
select '$ ? (@.a < 0.1)'::jsonpath;
@@ -623,15 +623,15 @@ select '$ ? (@.a < +1e1)'::jsonpath;
623623
(1 row)
624624

625625
select '$ ? (@.a < .1e1)'::jsonpath;
626-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
626+
ERROR: syntax error at or near "." of jsonpath input
627627
LINE 1: select '$ ? (@.a < .1e1)'::jsonpath;
628628
^
629629
select '$ ? (@.a < -.1e1)'::jsonpath;
630-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
630+
ERROR: syntax error at or near "." of jsonpath input
631631
LINE 1: select '$ ? (@.a < -.1e1)'::jsonpath;
632632
^
633633
select '$ ? (@.a < +.1e1)'::jsonpath;
634-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
634+
ERROR: syntax error at or near "." of jsonpath input
635635
LINE 1: select '$ ? (@.a < +.1e1)'::jsonpath;
636636
^
637637
select '$ ? (@.a < 0.1e1)'::jsonpath;
@@ -689,15 +689,15 @@ select '$ ? (@.a < +1e-1)'::jsonpath;
689689
(1 row)
690690

691691
select '$ ? (@.a < .1e-1)'::jsonpath;
692-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
692+
ERROR: syntax error at or near "." of jsonpath input
693693
LINE 1: select '$ ? (@.a < .1e-1)'::jsonpath;
694694
^
695695
select '$ ? (@.a < -.1e-1)'::jsonpath;
696-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
696+
ERROR: syntax error at or near "." of jsonpath input
697697
LINE 1: select '$ ? (@.a < -.1e-1)'::jsonpath;
698698
^
699699
select '$ ? (@.a < +.1e-1)'::jsonpath;
700-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
700+
ERROR: syntax error at or near "." of jsonpath input
701701
LINE 1: select '$ ? (@.a < +.1e-1)'::jsonpath;
702702
^
703703
select '$ ? (@.a < 0.1e-1)'::jsonpath;
@@ -755,15 +755,15 @@ select '$ ? (@.a < +1e+1)'::jsonpath;
755755
(1 row)
756756

757757
select '$ ? (@.a < .1e+1)'::jsonpath;
758-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
758+
ERROR: syntax error at or near "." of jsonpath input
759759
LINE 1: select '$ ? (@.a < .1e+1)'::jsonpath;
760760
^
761761
select '$ ? (@.a < -.1e+1)'::jsonpath;
762-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
762+
ERROR: syntax error at or near "." of jsonpath input
763763
LINE 1: select '$ ? (@.a < -.1e+1)'::jsonpath;
764764
^
765765
select '$ ? (@.a < +.1e+1)'::jsonpath;
766-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
766+
ERROR: syntax error at or near "." of jsonpath input
767767
LINE 1: select '$ ? (@.a < +.1e+1)'::jsonpath;
768768
^
769769
select '$ ? (@.a < 0.1e+1)'::jsonpath;
@@ -809,7 +809,7 @@ select '0'::jsonpath;
809809
(1 row)
810810

811811
select '00'::jsonpath;
812-
ERROR: syntax error, unexpected IDENT_P at end of jsonpath input
812+
ERROR: syntax error at end of jsonpath input
813813
LINE 1: select '00'::jsonpath;
814814
^
815815
select '0.0'::jsonpath;
@@ -935,18 +935,18 @@ select '(1.2).e3'::jsonpath;
935935
(1 row)
936936

937937
select '1..e'::jsonpath;
938-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
938+
ERROR: syntax error at or near "." of jsonpath input
939939
LINE 1: select '1..e'::jsonpath;
940940
^
941941
select '1..e3'::jsonpath;
942-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
942+
ERROR: syntax error at or near "." of jsonpath input
943943
LINE 1: select '1..e3'::jsonpath;
944944
^
945945
select '(1.).e'::jsonpath;
946-
ERROR: syntax error, unexpected ')' at or near ")" of jsonpath input
946+
ERROR: syntax error at or near ")" of jsonpath input
947947
LINE 1: select '(1.).e'::jsonpath;
948948
^
949949
select '(1.).e3'::jsonpath;
950-
ERROR: syntax error, unexpected ')' at or near ")" of jsonpath input
950+
ERROR: syntax error at or near ")" of jsonpath input
951951
LINE 1: select '(1.).e3'::jsonpath;
952952
^

0 commit comments

Comments
 (0)