mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-02 10:58:45 -05:00
QueryResult iterator nextRow() may get into infinite loop. Additionally, fixed handling of the case when each row of result could have a different count of fields.
20 lines
387 B
C++
20 lines
387 B
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "QueryResult.hpp"
|
|
|
|
QueryResult::QueryResult() : currentRow(0)
|
|
{}
|
|
|
|
void QueryResult::addRow(const std::vector<Field> &row)
|
|
{
|
|
rows.push_back(row);
|
|
}
|
|
|
|
bool QueryResult::nextRow()
|
|
{
|
|
++currentRow;
|
|
|
|
return (currentRow < rows.size());
|
|
}
|