- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit09991e5
committed
Fix some probably-minor oversights in readfuncs.c.
The system expects TABLEFUNC RTEs to have coltypes, coltypmods, andcolcollations lists, but outfuncs doesn't dump them and readfuncs doesn'trestore them. This doesn't cause obvious failures, because the only thingsthat look at those fields are expandRTE() and get_rte_attribute_type(),which are mostly used during parse analysis, before anything would'vepassed the parsetree through outfuncs/readfuncs. But expandRTE() is usedin build_physical_tlist(), which means that that function will return awrong answer for a TABLEFUNC RTE that came from a view. Very accidentally,this doesn't cause serious problems, because what it will return is NILwhich callers will interpret as "couldn't build a physical tlist becauseof dropped columns". So you still get a plan that works, though it'smarginally less efficient than it could be. There are also some otherexpandRTE() calls associated with transformation of whole-row Vars inthe planner. I have been unable to exhibit misbehavior from that, andit may be unreachable in any case that anyone would care about ... butI'm not entirely convinced, so this seems like something we should back-patch a fix for. Fortunately, we can fix it without forcing a changeof stored rules and a catversion bump, because we can just copy theselists from the subsidiary TableFunc object.readfuncs.c was also missing support for NamedTuplestoreScan plan nodes.This accidentally fails to break parallel query because a query usinga named tuplestore would never be considered parallel-safe anyway.However, project policy since parallel query came in is that all plannode types should have outfuncs/readfuncs support, so this is clearlyan oversight that should be repaired.Noted while fooling around with a patch to test outfuncs/readfuncs morethoroughly. That exposed some other issues too, but these are the onlyones that seem worth back-patching.Back-patch to v10 where both of these features came in.Discussion:https://postgr.es/m/17114.1537138992@sss.pgh.pa.us1 parent422952e commit09991e5
2 files changed
+30
-2
lines changedLines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1366 | 1366 |
| |
1367 | 1367 |
| |
1368 | 1368 |
| |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
1369 | 1378 |
| |
1370 | 1379 |
| |
1371 | 1380 |
| |
| |||
1909 | 1918 |
| |
1910 | 1919 |
| |
1911 | 1920 |
| |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
1912 | 1936 |
| |
1913 | 1937 |
| |
1914 | 1938 |
| |
| |||
2693 | 2717 |
| |
2694 | 2718 |
| |
2695 | 2719 |
| |
| 2720 | + | |
| 2721 | + | |
2696 | 2722 |
| |
2697 | 2723 |
| |
2698 | 2724 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1034 | 1034 |
| |
1035 | 1035 |
| |
1036 | 1036 |
| |
1037 |
| - | |
| 1037 | + | |
1038 | 1038 |
| |
1039 | 1039 |
| |
1040 | 1040 |
| |
1041 | 1041 |
| |
1042 | 1042 |
| |
1043 | 1043 |
| |
1044 | 1044 |
| |
1045 |
| - | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1046 | 1048 |
| |
1047 | 1049 |
| |
1048 | 1050 |
| |
|
0 commit comments
Comments
(0)