forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5b948b5
committed
Fix handling of R/W expanded datums that are passed to SQL functions.
fmgr_sql must make expanded-datum arguments read-only, becauseit's possible that the function body will pass the argument tomore than one callee function. If one of those functions takesthe datum's R/W property as license to scribble on it, then latercallees will see an unexpected value, leading to wrong answers.From a performance standpoint, it'd be nice to skip this in thecommon case that the argument value is passed to only one callee.However, detecting that seems fairly hard, and certainly notsomething that I care to attempt in a back-patched bug fix.Per report from Adam Mackler. This has been broken since weinvented expanded datums, so back-patch to all supported branches.Discussion:https://postgr.es/m/WScDU5qfoZ7PB2gXwNqwGGgDPmWzz08VdydcPFLhOwUKZcdWbblbo-0Lku-qhuEiZoXJ82jpiQU4hOjOcrevYEDeoAvz6nR0IU4IHhXnaCA=@mackler.emailDiscussion:https://postgr.es/m/187436.1660143060@sss.pgh.pa.us1 parent7cd0d52 commit5b948b5
File tree
3 files changed
+48
-3
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+48
-3
lines changedLines changed: 17 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
906 | 906 |
| |
907 | 907 |
| |
908 | 908 |
| |
| 909 | + | |
909 | 910 |
| |
910 | 911 |
| |
911 | 912 |
| |
| |||
922 | 923 |
| |
923 | 924 |
| |
924 | 925 |
| |
925 |
| - | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
926 | 938 |
| |
| 939 | + | |
| 940 | + | |
| 941 | + | |
927 | 942 |
| |
928 |
| - | |
| 943 | + | |
929 | 944 |
| |
930 | 945 |
| |
931 | 946 |
| |
|
Lines changed: 18 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
340 | 340 |
| |
341 | 341 |
| |
342 | 342 |
| |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
343 | 359 |
| |
344 | 360 |
| |
345 |
| - | |
| 361 | + | |
346 | 362 |
| |
347 | 363 |
| |
348 | 364 |
| |
| |||
364 | 380 |
| |
365 | 381 |
| |
366 | 382 |
| |
| 383 | + | |
367 | 384 |
| |
368 | 385 |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
219 | 219 |
| |
220 | 220 |
| |
221 | 221 |
| |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
222 | 235 |
| |
223 | 236 |
| |
224 | 237 |
| |
|
0 commit comments
Comments
(0)