forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd5a4b69
committed
Fix assertion failure when a SELECT DISTINCT ON expression is volatile.
In this case we generate two PathKey references to the expression (one forDISTINCT and one for ORDER BY) and they really need to refer to the sameEquivalenceClass. However get_eclass_for_sort_expr was being overly paranoidand creating two different EC's. Correct behavior is to use the SortGroupRefindex to decide whether two references to volatile expressions that areequal() (ie textually equivalent) should be considered the same.Backpatch to 8.4. Possibly this should be changed in 8.3 as well, butI'll refrain in the absence of evidence of a visible failure in that branch.Per bug #5049.1 parent8c5463a commitd5a4b69
File tree
4 files changed
+32
-5
lines changed- src
- backend/optimizer/path
- test/regress
- expected
- sql
4 files changed
+32
-5
lines changedLines changed: 12 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
357 | 357 |
| |
358 | 358 |
| |
359 | 359 |
| |
360 |
| - | |
| 360 | + | |
361 | 361 |
| |
362 | 362 |
| |
363 | 363 |
| |
| |||
388 | 388 |
| |
389 | 389 |
| |
390 | 390 |
| |
391 |
| - | |
392 |
| - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
393 | 397 |
| |
394 | 398 |
| |
395 | 399 |
| |
| |||
433 | 437 |
| |
434 | 438 |
| |
435 | 439 |
| |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
436 | 444 |
| |
437 | 445 |
| |
438 | 446 |
| |
|
Lines changed: 10 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
14 |
| - | |
| 14 | + | |
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| |||
635 | 635 |
| |
636 | 636 |
| |
637 | 637 |
| |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
638 | 647 |
| |
639 | 648 |
| |
640 | 649 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + |
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| 17 | + | |
| 18 | + | |
| 19 | + |
0 commit comments
Comments
(0)