forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite26114c
committed
Make JSON path numeric literals more correct
Per ECMAScript standard (ECMA-262, referenced by SQL standard), thesyntax forms.11.should be allowed for decimal numeric literals, but the existingimplementation rejected them.Also, by the same standard, reject trailing junk after numericliterals.Note that the ECMAScript standard for numeric literals is in respectslike these slightly different from the JSON standard, which might bethe original cause for this discrepancy.A change is that this kind of syntax is now rejected: 1.type()This needs to be written as (1).type()This is correct; normal JavaScript also does not accept this syntax.We also need to fix up the jsonpath output function for this case. Weput parentheses around numeric items if they are followed by anotherpath item.Reviewed-by: Nikita Glukhov <n.gluhov@postgrespro.ru>Discussion:https://www.postgresql.org/message-id/flat/50a828cc-0a00-7791-7883-2ed06dfb2dbb@enterprisedb.com1 parent91c0570 commite26114c
File tree
4 files changed
+176
-98
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
4 files changed
+176
-98
lines changedLines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
500 | 500 |
| |
501 | 501 |
| |
502 | 502 |
| |
| 503 | + | |
| 504 | + | |
503 | 505 |
| |
504 | 506 |
| |
505 | 507 |
| |
| 508 | + | |
| 509 | + | |
506 | 510 |
| |
507 | 511 |
| |
508 | 512 |
| |
|
Lines changed: 10 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
85 |
| - | |
86 |
| - | |
| 85 | + | |
87 | 86 |
| |
88 |
| - | |
89 |
| - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
90 | 92 |
| |
91 | 93 |
| |
92 | 94 |
| |
| |||
242 | 244 |
| |
243 | 245 |
| |
244 | 246 |
| |
245 |
| - | |
246 |
| - | |
247 |
| - | |
248 |
| - | |
249 |
| - | |
250 |
| - | |
251 |
| - | |
252 |
| - | |
253 |
| - | |
254 |
| - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
255 | 251 |
| |
256 | 252 |
| |
257 | 253 |
| |
|
0 commit comments
Comments
(0)