Commit a43d7a8
committed
Compare collations before merging UNION operations.
In the dim past we figured it was okay to ignore collations
when combining UNION set-operation nodes into a single N-way
UNION operation. I believe that was fine at the time, but
it stopped being fine when we added nondeterministic collations:
the semantics of distinct-ness are affected by those. v17 made
it even less fine by allowing per-child sorting operations to
be merged via MergeAppend, although I think we accidentally
avoided any live bug from that.
Add a check that collations match before deciding that two
UNION nodes are equivalent. I also failed to resist the
temptation to comment plan_union_children() a little better.
Back-patch to all supported branches (v13 now), since they
all have nondeterministic collations.
Discussion: https://postgr.es/m/3605568.1731970579@sss.pgh.pa.us1 parent c166454 commit a43d7a8
1 file changed
+12
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
722 | | - | |
723 | | - | |
724 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
| |||
1193 | 1193 | | |
1194 | 1194 | | |
1195 | 1195 | | |
1196 | | - | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
1197 | 1203 | | |
1198 | 1204 | | |
1199 | 1205 | | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
1205 | | - | |
1206 | | - | |
1207 | 1206 | | |
1208 | 1207 | | |
1209 | 1208 | | |
| |||
1232 | 1231 | | |
1233 | 1232 | | |
1234 | 1233 | | |
1235 | | - | |
| 1234 | + | |
| 1235 | + | |
1236 | 1236 | | |
1237 | 1237 | | |
1238 | 1238 | | |
| |||
0 commit comments