forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9e283fc

Etsuro Fujita
postgres_fdw: Fix handling of a pending asynchronous request in postgresReScanForeignScan().
Commit27e1f14 failed to process a pending asynchronous request madefor a given ForeignScan node in postgresReScanForeignScan() (if any) incases where we would only reset the next_tuple counter in that function,contradicting the assumption that there should be no pendingasynchronous requests that have been made for async-capable subplans forthe parent Append node after ReScan. This led to an assert failure inan assert-enabled build. I think this would also lead to mis-rewindingthe cursor in that function in the case where we have already fetchedone batch for the ForeignScan node and the asynchronous request has beenmade for the second batch, because even in that case we would just resetthe counter when called from that function, so we would fail to executeMOVE BACKWARD ALL.To fix, modify that function to process the asynchronous request beforerestarting the scan.While at it, add a comment to a function to match other places.Per bug #17344 from Alexander Lakhin. Back-patch to v14 where theaforesaid commit came in.Patch by me. Test case by Alexander Lakhin, adjusted by me. Reviewedand tested by Alexander Lakhin and Dmitry Dolgov.Discussion:https://postgr.es/m/17344-226b78b00de73a7e@postgresql.org1 parentce6d793 commit9e283fc
File tree
3 files changed
+68
-0
lines changed- contrib/postgres_fdw
- expected
- sql
3 files changed
+68
-0
lines changedLines changed: 37 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10800 | 10800 |
| |
10801 | 10801 |
| |
10802 | 10802 |
| |
| 10803 | + | |
| 10804 | + | |
| 10805 | + | |
| 10806 | + | |
| 10807 | + | |
| 10808 | + | |
| 10809 | + | |
| 10810 | + | |
| 10811 | + | |
| 10812 | + | |
| 10813 | + | |
| 10814 | + | |
| 10815 | + | |
| 10816 | + | |
| 10817 | + | |
| 10818 | + | |
| 10819 | + | |
| 10820 | + | |
| 10821 | + | |
| 10822 | + | |
| 10823 | + | |
| 10824 | + | |
| 10825 | + | |
| 10826 | + | |
| 10827 | + | |
| 10828 | + | |
| 10829 | + | |
| 10830 | + | |
| 10831 | + | |
| 10832 | + | |
| 10833 | + | |
| 10834 | + | |
| 10835 | + | |
| 10836 | + | |
| 10837 | + | |
| 10838 | + | |
| 10839 | + | |
10803 | 10840 |
| |
10804 | 10841 |
| |
10805 | 10842 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1651 | 1651 |
| |
1652 | 1652 |
| |
1653 | 1653 |
| |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
1654 | 1666 |
| |
1655 | 1667 |
| |
1656 | 1668 |
| |
| |||
6999 | 7011 |
| |
7000 | 7012 |
| |
7001 | 7013 |
| |
| 7014 | + | |
| 7015 | + | |
7002 | 7016 |
| |
7003 | 7017 |
| |
7004 | 7018 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3431 | 3431 |
| |
3432 | 3432 |
| |
3433 | 3433 |
| |
| 3434 | + | |
| 3435 | + | |
| 3436 | + | |
| 3437 | + | |
| 3438 | + | |
| 3439 | + | |
| 3440 | + | |
| 3441 | + | |
| 3442 | + | |
| 3443 | + | |
| 3444 | + | |
| 3445 | + | |
| 3446 | + | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
| 3450 | + | |
3434 | 3451 |
| |
3435 | 3452 |
| |
3436 | 3453 |
| |
|
0 commit comments
Comments
(0)