- Notifications
You must be signed in to change notification settings - Fork4.9k
Commite452184
committed
Fix CLUSTER tuplesorts on abbreviated expressions.
CLUSTER sort won't use the datum1 SortTuple field when clusteringagainst an index whose leading key is an expression. This makes itunsafe to use the abbreviated keys optimization, which was missed by thelogic that sets up SortSupport state. Affected tuplesorts output tuplesin a completely bogus order as a result (the wrong SortSupport basedcomparator was used for the leading attribute).This issue is similar to the bug fixed on the master branch by recentcommitcc58eec. But it's a far older issue, that dates back to theintroduction of the abbreviated keys optimization by commit4ea51cd.Backpatch to all supported versions.Author: Peter Geoghegan <pg@bowt.ie>Author: Thomas Munro <thomas.munro@gmail.com>Discussion:https://postgr.es/m/CA+hUKG+bA+bmwD36_oDxAoLrCwZjVtST2fqe=b4=qZcmU7u89A@mail.gmail.comBackpatch: 10-1 parente346329 commite452184
File tree
3 files changed
+23
-1
lines changed- src
- backend/utils/sort
- test/regress
- expected
- sql
3 files changed
+23
-1
lines changedLines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
975 | 975 |
| |
976 | 976 |
| |
977 | 977 |
| |
| 978 | + | |
978 | 979 |
| |
979 | 980 |
| |
980 | 981 |
| |
| |||
1007 | 1008 |
| |
1008 | 1009 |
| |
1009 | 1010 |
| |
| 1011 | + | |
1010 | 1012 |
| |
1011 | 1013 |
| |
1012 | 1014 |
| |
| |||
1045 | 1047 |
| |
1046 | 1048 |
| |
1047 | 1049 |
| |
1048 |
| - | |
| 1050 | + | |
1049 | 1051 |
| |
1050 | 1052 |
| |
1051 | 1053 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
511 | 511 |
| |
512 | 512 |
| |
513 | 513 |
| |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
514 | 521 |
| |
515 | 522 |
| |
516 | 523 |
| |
| |||
545 | 552 |
| |
546 | 553 |
| |
547 | 554 |
| |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
548 | 562 |
| |
549 | 563 |
| |
550 | 564 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
245 | 245 |
| |
246 | 246 |
| |
247 | 247 |
| |
| 248 | + | |
| 249 | + | |
| 250 | + | |
248 | 251 |
| |
249 | 252 |
| |
250 | 253 |
| |
| |||
255 | 258 |
| |
256 | 259 |
| |
257 | 260 |
| |
| 261 | + | |
| 262 | + | |
| 263 | + | |
258 | 264 |
| |
259 | 265 |
| |
260 | 266 |
| |
|
0 commit comments
Comments
(0)