mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 03:20:11 +01:00
another fix for #1203: need to reset _rowMap as well. Also, don't hide reset() from base class
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -70,7 +70,7 @@ RecordSet::RecordSet(const RecordSet& other):
|
||||
_pFilter(other._pFilter),
|
||||
_totalRowCount(other._totalRowCount)
|
||||
{
|
||||
if(_pFilter) _pFilter->duplicate();
|
||||
if (_pFilter) _pFilter->duplicate();
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
@@ -378,7 +383,7 @@ void RecordSet::filter(RowFilter* pFilter)
|
||||
{
|
||||
if (_pFilter) _pFilter->release();
|
||||
_pFilter = pFilter;
|
||||
if(_pFilter) _pFilter->duplicate();
|
||||
if (_pFilter) _pFilter->duplicate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user