Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d9309f

Browse files
committed
Allow NumericOnly to be "+ FCONST".
The NumericOnly grammar production accepted ICONST, + ICONST, - ICONST, FCONST, and - FCONST, but for some reason not + FCONST. This led to strange inconsistencies like regression=# set random_page_cost = +4; SET regression=# set random_page_cost = 4000000000; SET regression=# set random_page_cost = +4000000000; ERROR: syntax error at or near "4000000000" (because 4000000000 is too large to be an ICONST). While there's no actual functional reason to need to write a "+", if we allow it for integers it seems like we should allow it for numerics too. It's been like that forever, so back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected]
1 parent 525780c commit 7d9309f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/backend/parser/gram.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3396,6 +3396,7 @@ opt_by: BY {}
33963396

33973397
NumericOnly:
33983398
FCONST { $$ = makeFloat($1); }
3399+
| '+' FCONST { $$ = makeFloat($2); }
33993400
| '-' FCONST
34003401
{
34013402
$$ = makeFloat($2);

0 commit comments

Comments
 (0)