forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5db9367
committed
Fix UNION planner datatype issue
66c0185 gave the planner the ability to have union child queriesprovide the union planner with pre-sorted input so that UNION queriescould be more efficiently implemented using Merge Append.That commit overlooked checking that the UNION target list and the unionchild target list's types all match. In some corner cases, this couldresult in the planner producing sorts using the sort operator of thetop-level UNION's target list type rather than of the union child'starget list's type. The implications of this range from silentlyworking correctly, despite using the wrong sort operator all the way upto a segmentation fault.Here we fix by adjusting the planner so it makes no attempt to have thesubquery produce pre-sorted results when the data type of the UNIONtarget list and the types from the subquery target list don't matchexactly.Backpatch to 17, where66c0185 was introduced.Reported-by: Jason Smith <dqetool@126.com>Diagnosed-by: Tom Lane <tgl@sss.pgh.pa.us>Bug: 18764Discussion:https://postgr.es/m/18764-63ad667ea26e877a%40postgresql.orgBackpatch-through: 171 parentc559f61 commit5db9367
1 file changed
+22
-2
lines changedLines changed: 22 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8086 | 8086 |
| |
8087 | 8087 |
| |
8088 | 8088 |
| |
8089 |
| - | |
| 8089 | + | |
| 8090 | + | |
| 8091 | + | |
| 8092 | + | |
8090 | 8093 |
| |
8091 | 8094 |
| |
8092 | 8095 |
| |
8093 | 8096 |
| |
8094 | 8097 |
| |
8095 | 8098 |
| |
8096 | 8099 |
| |
| 8100 | + | |
8097 | 8101 |
| |
8098 | 8102 |
| |
| 8103 | + | |
8099 | 8104 |
| |
8100 | 8105 |
| |
8101 | 8106 |
| |
8102 | 8107 |
| |
| 8108 | + | |
8103 | 8109 |
| |
8104 | 8110 |
| |
8105 | 8111 |
| |
8106 | 8112 |
| |
8107 | 8113 |
| |
8108 |
| - | |
| 8114 | + | |
| 8115 | + | |
| 8116 | + | |
| 8117 | + | |
8109 | 8118 |
| |
| 8119 | + | |
8110 | 8120 |
| |
| 8121 | + | |
| 8122 | + | |
| 8123 | + | |
| 8124 | + | |
| 8125 | + | |
| 8126 | + | |
8111 | 8127 |
| |
| 8128 | + | |
8112 | 8129 |
| |
8113 | 8130 |
| |
8114 | 8131 |
| |
8115 | 8132 |
| |
| 8133 | + | |
8116 | 8134 |
| |
| 8135 | + | |
| 8136 | + | |
8117 | 8137 |
| |
8118 | 8138 |
|
0 commit comments
Comments
(0)