summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-06-14 03:14:41 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-06-14 13:03:55 +0100
commit6141507d5a13c4958e429dd65f6cd28c6e8dabe8 (patch)
treee528e8236791fc66833febaf73f3b7392b772f7c
parentDefault constructor and proper copy operator for ConnectionRef (diff)
downloadproject2-6141507d5a13c4958e429dd65f6cd28c6e8dabe8.tar.bz2
project2-6141507d5a13c4958e429dd65f6cd28c6e8dabe8.tar.xz
project2-6141507d5a13c4958e429dd65f6cd28c6e8dabe8.zip
Fix off by one error in rowstack
-rw-r--r--project2/common/execContext.cpp2
-rw-r--r--project2/sql/sqlMergeTask.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/project2/common/execContext.cpp b/project2/common/execContext.cpp
index 462de8b..bbec92a 100644
--- a/project2/common/execContext.cpp
+++ b/project2/common/execContext.cpp
@@ -50,7 +50,7 @@ ExecContext::RowValuesPop()
const RowState *
ExecContext::RowValues(size_t depth) const
{
- if (depth > rowValuesStack.size()) {
+ if (depth < 1 || depth > rowValuesStack.size()) {
throw RowSet::ParentOutOfRange(depth);
}
return rowValuesStack.at(rowValuesStack.size() - depth);
diff --git a/project2/sql/sqlMergeTask.cpp b/project2/sql/sqlMergeTask.cpp
index 54d4baf..91bf3e0 100644
--- a/project2/sql/sqlMergeTask.cpp
+++ b/project2/sql/sqlMergeTask.cpp
@@ -276,7 +276,7 @@ class Populate : public NoOutputExecute {
void execute(ExecContext * ec) const
{
unsigned int idx = 0;
- ec->RowValues(0)->foreachColumn(ec, boost::bind(&Populate::bind, this, boost::ref(idx), _3));
+ ec->RowValues(1)->foreachColumn(ec, boost::bind(&Populate::bind, this, boost::ref(idx), _3));
cmd->execute();
}
private: