]> granicus.if.org Git - postgresql/commit
Fix an error in the original coding of holdable cursors: PersistHoldablePortal
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 6 Feb 2007 22:49:48 +0000 (22:49 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 6 Feb 2007 22:49:48 +0000 (22:49 +0000)
commitdec65c942116f6b21222f29627a79cb133740879
tree76bc6c2800d20bbfb4011acdcb305f02a718d9f9
parentf0083ccfde0cfc5028afe8c3a6d647f627516b61
Fix an error in the original coding of holdable cursors: PersistHoldablePortal
thought that it didn't have to reposition the underlying tuplestore if the
portal is atEnd.  But this is not so, because tuplestores have separate read
and write cursors ... and the read cursor hasn't moved from the start.
This mistake explains bug #2970 from William Zhang.

Note: the coding here is pretty inefficient, but given that no one has noticed
this bug until now, I'd say hardly anyone uses the case where the cursor has
been advanced before being persisted.  So maybe it's not worth worrying about.
src/backend/commands/portalcmds.c