forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit133924e
committed
Fix potential failure when hashing the output of a subplan that produces
a pass-by-reference datatype with a nontrivial projection step.We were using the same memory context for the projection operation as forthe temporary context used by the hashtable routines in execGrouping.c.However, the hashtable routines feel free to reset their temp context atany time, which'd lead to destroying input data that was still needed.Report and diagnosis by Tao Ma.Back-patch to 8.1, where the problem was introduced by the changes thatallowed us to work with "virtual" tuples instead of materializing intermediatetuple values everywhere. The earlier code looks quite similar, but it doesn'tsuffer the problem because the data gets copied into another context as aresult of having to materialize ExecProject's output tuple.1 parent4ff9c8d commit133924e
File tree
4 files changed
+36
-20
lines changed- src
- backend/executor
- include/nodes
- test/regress
- expected
- sql
4 files changed
+36
-20
lines changedLines changed: 17 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
89 | 89 |
| |
90 | 90 |
| |
91 | 91 |
| |
92 |
| - | |
93 | 92 |
| |
94 | 93 |
| |
95 | 94 |
| |
| |||
126 | 125 |
| |
127 | 126 |
| |
128 | 127 |
| |
129 |
| - | |
130 |
| - | |
131 |
| - | |
132 |
| - | |
133 |
| - | |
134 |
| - | |
135 | 128 |
| |
136 | 129 |
| |
137 | 130 |
| |
| |||
438 | 431 |
| |
439 | 432 |
| |
440 | 433 |
| |
441 |
| - | |
442 | 434 |
| |
443 | 435 |
| |
444 | 436 |
| |
| |||
460 | 452 |
| |
461 | 453 |
| |
462 | 454 |
| |
463 |
| - | |
| 455 | + | |
464 | 456 |
| |
465 | 457 |
| |
466 | 458 |
| |
| |||
476 | 468 |
| |
477 | 469 |
| |
478 | 470 |
| |
479 |
| - | |
480 |
| - | |
| 471 | + | |
| 472 | + | |
481 | 473 |
| |
482 | 474 |
| |
483 | 475 |
| |
| |||
495 | 487 |
| |
496 | 488 |
| |
497 | 489 |
| |
498 |
| - | |
499 |
| - | |
| 490 | + | |
| 491 | + | |
500 | 492 |
| |
501 | 493 |
| |
502 | 494 |
| |
| |||
555 | 547 |
| |
556 | 548 |
| |
557 | 549 |
| |
558 |
| - | |
| 550 | + | |
559 | 551 |
| |
560 | 552 |
| |
561 | 553 |
| |
| |||
680 | 672 |
| |
681 | 673 |
| |
682 | 674 |
| |
683 |
| - | |
| 675 | + | |
| 676 | + | |
684 | 677 |
| |
685 | 678 |
| |
686 | 679 |
| |
| |||
730 | 723 |
| |
731 | 724 |
| |
732 | 725 |
| |
733 |
| - | |
| 726 | + | |
734 | 727 |
| |
735 | 728 |
| |
736 | 729 |
| |
737 | 730 |
| |
738 | 731 |
| |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
739 | 739 |
| |
740 | 740 |
| |
741 | 741 |
| |
|
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
699 | 699 |
| |
700 | 700 |
| |
701 | 701 |
| |
702 |
| - | |
703 |
| - | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
704 | 705 |
| |
705 | 706 |
| |
706 | 707 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
521 | 521 |
| |
522 | 522 |
| |
523 | 523 |
| |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + |
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
335 | 335 |
| |
336 | 336 |
| |
337 | 337 |
| |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + |
0 commit comments
Comments
(0)