nbtree's ScalarArrayOp array mark/restore code appears to be buggy
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2023-09-23T03:17:16Z
Lists: pgsql-hackers
Attachments
- nbtree_array_mark_restore_bug.sql (application/octet-stream)
Attached test case demonstrates an issue with nbtree's mark/restore code. All supported versions are affected. My suspicion is that bugfix commit 70bc5833 missed some subtlety around what we need to do to make sure that the array keys stay "in sync" with the scan. I'll have time to debug the problem some more tomorrow. My ScalarArrayOp project [1] seems unaffected by the bug, so I don't expect it'll take long to get to the bottom of this. This is probably due to its general design, and not any specific detail. The patch makes the relationship between the current scan position and the current array keys a great deal looser. [1] https://commitfest.postgresql.org/44/4455/ -- Peter Geoghegan
Commits
-
Fix btmarkpos/btrestrpos array key wraparound bug.
- 714780dcddf0 17.0 landed
- 3fa81b62e09b 16.1 landed
- cac37c1a1b7c 15.5 landed
- 41486c4aaeb1 14.10 landed
- d4724e94a1eb 13.13 landed
- b36d72cbc6b0 12.17 landed
- 7c07305e6f02 11.22 landed
-
Fix btmarkpos/btrestrpos to handle array keys.
- 70bc5833195d 9.3.0 cited