DERBY-6981: NullPointerException when re-executing PreparedStatement query.

TableScanResultSet's past2FutureTbl is a hash table containing updated
rows that are thrown into the future direction of the index scan, so
that the scan knows it's seen these rows already and should skip them
subsequently.

When the TableScanResultSet.close() method was called, it was closing the
past2FutureTbl, but not clearing the pointer, which caused the lazy
initialization of the past2FutureTbl to be incorrectly performed the
next time the same TableScanResultSet was opened and scanned, resulting
in the NullPointerException in the underlying BackingStoreHashtable code
in that second scan.

The fix is to clear the old instance and freshly initialize a new instance,
each time the TableScanResultSet is closed and reopened.



git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1823037 13f79535-47bb-0310-9956-ffa450edef68
2 files changed