- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit0f43083
committed
functions.c: copy trees from source_list before parse analysis etc.
This is yet another bit of fallout from the fact that backend/parser(like other code) feels free to scribble on the parse tree it'shanded. In this case that resulted in modifying therelatively-short-lived copy in the cached function's source_list.That would be fine since we only need each source_list tree once... except that if the parser fails after making some changes,the function cache entry remains as-is and will still be thereif the user tries to execute the function again. Then we haveproblems because we're feeding a non-pristine tree to the parser.The most expedient fix is a quick copyObject(). I consideredother answers like somehow marking the cache entry invalidtemporarily, but that would add complexity and I'm not sureit's worth it. In typical scenarios we'd only do this onceper function query per session.Reported-by: Alexander Lakhin <exclusion@gmail.com>Author: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/6d442183-102c-498a-81d1-eeeb086cdc5a@gmail.com1 parent2ef5790 commit0f43083
1 file changed
+8
-1
lines changedLines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
871 | 871 |
| |
872 | 872 |
| |
873 | 873 |
| |
874 |
| - | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
875 | 880 |
| |
876 | 881 |
| |
877 | 882 |
| |
878 | 883 |
| |
879 | 884 |
| |
880 | 885 |
| |
| 886 | + | |
881 | 887 |
| |
882 | 888 |
| |
883 | 889 |
| |
| |||
889 | 895 |
| |
890 | 896 |
| |
891 | 897 |
| |
| 898 | + | |
892 | 899 |
| |
893 | 900 |
| |
894 | 901 |
| |
|
0 commit comments
Comments
(0)