another fix for #1203: need to reset _rowMap as well. Also, don't hide reset() from base class

This commit is contained in:
Guenter Obiltschnig
2016-03-17 10:07:40 +01:00
parent 65a92d4c5c
commit 6f44a02a65
2 changed files with 50 additions and 42 deletions

View File

@@ -315,6 +315,9 @@ public:
/// Returns true if there is at least one row in the RecordSet,
/// false otherwise.
using Statement::reset;
/// Don't hide base class method.
void reset(const Statement& stmt);
/// Resets the RecordSet and assigns a new statement.
/// Should be called after the given statement has been reset,
@@ -471,7 +474,6 @@ private:
void filter(RowFilter* pFilter);
/// Sets the filter for the RecordSet.
const RowFilter* getFilter() const;
/// Returns the filter associated with the RecordSet.
@@ -491,6 +493,7 @@ private:
/// inlines
///
inline Data_API std::ostream& operator << (std::ostream &os, const RecordSet& rs)
{
return rs.copy(os);

View File

@@ -102,6 +102,11 @@ void RecordSet::reset(const Statement& stmt)
_currentRow = 0;
_totalRowCount = UNKNOWN_TOTAL_ROW_COUNT;
RowMap::iterator it = _rowMap.begin();
RowMap::iterator end = _rowMap.end();
for (; it != end; ++it) delete it->second;
_rowMap.clear();
Statement::operator = (stmt);
_pBegin = new RowIterator(this, 0 == rowsExtracted());