- Notifications
You must be signed in to change notification settings - Fork4.9k
Commite33f233
committed
Avoid double transformation of json_array()'s subquery.
transformJsonArrayQueryConstructor() applied transformStmt() tothe same subquery tree twice. While this causes no issue in manycases, there are some where it causes a coredump, thanks to theparser's habit of scribbling on its input.Fix by making a copy before the first transformation (compare0f43083). This is quite brute-force, but then so is thewhole business of transforming the input twice. Per discussionin the bug thread, this implementation of json_array() parsingshould be replaced completely. But that will take some workand will surely not be back-patchable, so for the moment let'stake the easy way out.Oversight in7081ac4. Back-patch to v16 where that came in.Bug: #18877Reported-by: Yu Liang <luy70@psu.edu>Author: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/18877-c3c3ad75845833bb@postgresql.orgBackpatch-through: 161 parent5db3bf7 commite33f233
File tree
3 files changed
+9
-1
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+9
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3772 | 3772 |
| |
3773 | 3773 |
| |
3774 | 3774 |
| |
3775 |
| - | |
| 3775 | + | |
3776 | 3776 |
| |
3777 | 3777 |
| |
3778 | 3778 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
751 | 751 |
| |
752 | 752 |
| |
753 | 753 |
| |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
754 | 760 |
| |
755 | 761 |
| |
756 | 762 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
199 | 199 |
| |
200 | 200 |
| |
201 | 201 |
| |
| 202 | + | |
| 203 | + | |
202 | 204 |
| |
203 | 205 |
| |
204 | 206 |
| |
|
0 commit comments
Comments
(0)