- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit717e8a1
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 parent5e6e97f commit717e8a1
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 | |
---|---|---|---|
| |||
3764 | 3764 |
| |
3765 | 3765 |
| |
3766 | 3766 |
| |
3767 |
| - | |
| 3767 | + | |
3768 | 3768 |
| |
3769 | 3769 |
| |
3770 | 3770 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
747 | 747 |
| |
748 | 748 |
| |
749 | 749 |
| |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
750 | 756 |
| |
751 | 757 |
| |
752 | 758 |
| |
|
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)