Commit 8cc1eae
Fix error reporting for SQL/JSON path type mismatches
transformJsonFuncExpr() used exprType()/exprLocation() on the
possibly coerced path expression, which could be NULL when
coercion to jsonpath failed. Preserve the original expression
node so that type and location in the "must be of type jsonpath"
error are reported correctly. Add regression tests to cover
these cases.
Reported-by: Jian He <jian.universality@gmail.com>
Author: Jian He <jian.universality@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Discussion: https://postgr.es/m/CACJufxHunVg81JMuNo8Yvv_hJD0DicgaVN2Wteu8aJbVJPBjZA@mail.gmail.com
Backpatch-through: 171 parent 417ac9c commit 8cc1eae
File tree
3 files changed
+26
-8
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+26
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4285 | 4285 | | |
4286 | 4286 | | |
4287 | 4287 | | |
| 4288 | + | |
4288 | 4289 | | |
4289 | 4290 | | |
4290 | 4291 | | |
| |||
4500 | 4501 | | |
4501 | 4502 | | |
4502 | 4503 | | |
4503 | | - | |
4504 | | - | |
4505 | | - | |
4506 | | - | |
4507 | | - | |
| 4504 | + | |
| 4505 | + | |
| 4506 | + | |
| 4507 | + | |
| 4508 | + | |
| 4509 | + | |
| 4510 | + | |
| 4511 | + | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
4508 | 4515 | | |
4509 | 4516 | | |
4510 | 4517 | | |
4511 | | - | |
4512 | | - | |
4513 | | - | |
| 4518 | + | |
| 4519 | + | |
| 4520 | + | |
| 4521 | + | |
4514 | 4522 | | |
4515 | 4523 | | |
4516 | 4524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1331 | 1331 | | |
1332 | 1332 | | |
1333 | 1333 | | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
1334 | 1338 | | |
1335 | 1339 | | |
1336 | 1340 | | |
| |||
1355 | 1359 | | |
1356 | 1360 | | |
1357 | 1361 | | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
1358 | 1366 | | |
1359 | 1367 | | |
1360 | 1368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
453 | 454 | | |
454 | 455 | | |
455 | 456 | | |
| |||
460 | 461 | | |
461 | 462 | | |
462 | 463 | | |
| 464 | + | |
463 | 465 | | |
464 | 466 | | |
465 | 467 | | |
| |||
0 commit comments