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

Commit 03cefe8

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 97b005f commit 03cefe8

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
@@ -569,15 +569,15 @@ select '$ ? (@.a < +1)'::jsonpath;
569569
(1 row)
570570

571571
select '$ ? (@.a < .1)'::jsonpath;
572-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
572+
ERROR: syntax error at or near "." of jsonpath input
573573
LINE 1: select '$ ? (@.a < .1)'::jsonpath;
574574
^
575575
select '$ ? (@.a < -.1)'::jsonpath;
576-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
576+
ERROR: syntax error at or near "." of jsonpath input
577577
LINE 1: select '$ ? (@.a < -.1)'::jsonpath;
578578
^
579579
select '$ ? (@.a < +.1)'::jsonpath;
580-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
580+
ERROR: syntax error at or near "." of jsonpath input
581581
LINE 1: select '$ ? (@.a < +.1)'::jsonpath;
582582
^
583583
select '$ ? (@.a < 0.1)'::jsonpath;
@@ -635,15 +635,15 @@ select '$ ? (@.a < +1e1)'::jsonpath;
635635
(1 row)
636636

637637
select '$ ? (@.a < .1e1)'::jsonpath;
638-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
638+
ERROR: syntax error at or near "." of jsonpath input
639639
LINE 1: select '$ ? (@.a < .1e1)'::jsonpath;
640640
^
641641
select '$ ? (@.a < -.1e1)'::jsonpath;
642-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
642+
ERROR: syntax error at or near "." of jsonpath input
643643
LINE 1: select '$ ? (@.a < -.1e1)'::jsonpath;
644644
^
645645
select '$ ? (@.a < +.1e1)'::jsonpath;
646-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
646+
ERROR: syntax error at or near "." of jsonpath input
647647
LINE 1: select '$ ? (@.a < +.1e1)'::jsonpath;
648648
^
649649
select '$ ? (@.a < 0.1e1)'::jsonpath;
@@ -701,15 +701,15 @@ select '$ ? (@.a < +1e-1)'::jsonpath;
701701
(1 row)
702702

703703
select '$ ? (@.a < .1e-1)'::jsonpath;
704-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
704+
ERROR: syntax error at or near "." of jsonpath input
705705
LINE 1: select '$ ? (@.a < .1e-1)'::jsonpath;
706706
^
707707
select '$ ? (@.a < -.1e-1)'::jsonpath;
708-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
708+
ERROR: syntax error at or near "." of jsonpath input
709709
LINE 1: select '$ ? (@.a < -.1e-1)'::jsonpath;
710710
^
711711
select '$ ? (@.a < +.1e-1)'::jsonpath;
712-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
712+
ERROR: syntax error at or near "." of jsonpath input
713713
LINE 1: select '$ ? (@.a < +.1e-1)'::jsonpath;
714714
^
715715
select '$ ? (@.a < 0.1e-1)'::jsonpath;
@@ -767,15 +767,15 @@ select '$ ? (@.a < +1e+1)'::jsonpath;
767767
(1 row)
768768

769769
select '$ ? (@.a < .1e+1)'::jsonpath;
770-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
770+
ERROR: syntax error at or near "." of jsonpath input
771771
LINE 1: select '$ ? (@.a < .1e+1)'::jsonpath;
772772
^
773773
select '$ ? (@.a < -.1e+1)'::jsonpath;
774-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
774+
ERROR: syntax error at or near "." of jsonpath input
775775
LINE 1: select '$ ? (@.a < -.1e+1)'::jsonpath;
776776
^
777777
select '$ ? (@.a < +.1e+1)'::jsonpath;
778-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
778+
ERROR: syntax error at or near "." of jsonpath input
779779
LINE 1: select '$ ? (@.a < +.1e+1)'::jsonpath;
780780
^
781781
select '$ ? (@.a < 0.1e+1)'::jsonpath;
@@ -821,7 +821,7 @@ select '0'::jsonpath;
821821
(1 row)
822822

823823
select '00'::jsonpath;
824-
ERROR: syntax error, unexpected IDENT_P at end of jsonpath input
824+
ERROR: syntax error at end of jsonpath input
825825
LINE 1: select '00'::jsonpath;
826826
^
827827
select '0.0'::jsonpath;
@@ -947,18 +947,18 @@ select '(1.2).e3'::jsonpath;
947947
(1 row)
948948

949949
select '1..e'::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..e'::jsonpath;
952952
^
953953
select '1..e3'::jsonpath;
954-
ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
954+
ERROR: syntax error at or near "." of jsonpath input
955955
LINE 1: select '1..e3'::jsonpath;
956956
^
957957
select '(1.).e'::jsonpath;
958-
ERROR: syntax error, unexpected ')' at or near ")" of jsonpath input
958+
ERROR: syntax error at or near ")" of jsonpath input
959959
LINE 1: select '(1.).e'::jsonpath;
960960
^
961961
select '(1.).e3'::jsonpath;
962-
ERROR: syntax error, unexpected ')' at or near ")" of jsonpath input
962+
ERROR: syntax error at or near ")" of jsonpath input
963963
LINE 1: select '(1.).e3'::jsonpath;
964964
^

0 commit comments

Comments
 (0)