Re: nbtree's ScalarArrayOp array mark/restore code appears to be buggy

2023-09-25 Thread Peter Geoghegan
On Sat, Sep 23, 2023 at 4:22 PM Peter Geoghegan wrote: > Attached draft patch shows how this could work. > > _bt_restore_array_keys() has comments that seem to suppose that > calling _bt_preprocess_keys is fairly expensive, and something that's > well worth avoiding. But...is it, really? I wonder

Re: nbtree's ScalarArrayOp array mark/restore code appears to be buggy

2023-09-23 Thread Peter Geoghegan
On Sat, Sep 23, 2023 at 11:47 AM Peter Geoghegan wrote: > The fix for this should be fairly straightforward. We must teach > _bt_restore_array_keys() to distinguish "past the end of the array" > from "after the start of the array", so that doesn't spuriously skip a > required call to

Re: nbtree's ScalarArrayOp array mark/restore code appears to be buggy

2023-09-23 Thread Peter Geoghegan
On Fri, Sep 22, 2023 at 8:17 PM Peter Geoghegan wrote: > 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. I've figured out what's

nbtree's ScalarArrayOp array mark/restore code appears to be buggy

2023-09-22 Thread Peter Geoghegan
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