mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-25 06:36:37 +01:00
[SF 2593784] SVN trunk RowIterator
This commit is contained in:
@@ -54,7 +54,7 @@ namespace Data {
|
||||
RecordSet::RecordSet(const Statement& rStatement):
|
||||
Statement(rStatement),
|
||||
_currentRow(0),
|
||||
_pBegin(new RowIterator(this, 0 == extractionCount())),
|
||||
_pBegin(new RowIterator(this, 0 == rowsExtracted())),
|
||||
_pEnd(new RowIterator(this, true)),
|
||||
_pFilter(0)
|
||||
{
|
||||
@@ -66,7 +66,7 @@ RecordSet::RecordSet(Session& rSession,
|
||||
RowFormatter* pRowFormatter):
|
||||
Statement((rSession << query, now)),
|
||||
_currentRow(0),
|
||||
_pBegin(new RowIterator(this, 0 == extractionCount())),
|
||||
_pBegin(new RowIterator(this, 0 == rowsExtracted())),
|
||||
_pEnd(new RowIterator(this, true)),
|
||||
_pFilter(0)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ RecordSet::RecordSet(Session& rSession,
|
||||
RecordSet::RecordSet(const RecordSet& other):
|
||||
Statement(other.impl().duplicate()),
|
||||
_currentRow(other._currentRow),
|
||||
_pBegin(new RowIterator(this, 0 == extractionCount())),
|
||||
_pBegin(new RowIterator(this, 0 == rowsExtracted())),
|
||||
_pEnd(new RowIterator(this, true)),
|
||||
_pFilter(other._pFilter)
|
||||
{
|
||||
@@ -161,7 +161,8 @@ Poco::Dynamic::Var RecordSet::value(const std::string& name, std::size_t row, bo
|
||||
|
||||
Row& RecordSet::row(std::size_t pos)
|
||||
{
|
||||
if (pos > rowCount() - 1)
|
||||
std::size_t rowCnt = rowCount();
|
||||
if (0 == rowCnt || pos > rowCnt - 1)
|
||||
throw RangeException("Invalid recordset row requested.");
|
||||
|
||||
RowMap::const_iterator it = _rowMap.find(pos);
|
||||
|
||||
@@ -394,6 +394,20 @@ void StatementImpl::removeBind(const std::string& name)
|
||||
}
|
||||
|
||||
|
||||
std::size_t StatementImpl::rowsExtracted(int dataSet) const
|
||||
{
|
||||
if (-1 == dataSet) dataSet = _curDataSet;
|
||||
if (extractions().size() > 0)
|
||||
{
|
||||
poco_assert (dataSet >= 0);
|
||||
if (_extractors[dataSet].size() > 0)
|
||||
return _extractors[dataSet][0]->numOfRowsHandled();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void StatementImpl::formatSQL(std::vector<Any>& arguments)
|
||||
{
|
||||
std::string sql;
|
||||
|
||||
Reference in New Issue
Block a user