GH #499: Poco::Data::Statement::execute returns wrong value when zero results (ODBC)

This commit is contained in:
Aleksandar Fabijanic
2014-12-17 23:36:26 -06:00
parent 55dffd864f
commit 86b81bfcbd
24 changed files with 80 additions and 18 deletions

View File

@@ -144,7 +144,14 @@ std::size_t StatementImpl::executeWithLimit()
else
_state = ST_PAUSED;
return count ? count : affectedRowCount();
int affectedRows = affectedRowCount();
if (count == 0)
{
if (affectedRows > 0)
return affectedRows;
}
return count;
}
@@ -159,7 +166,14 @@ std::size_t StatementImpl::executeWithoutLimit()
while (hasNext()) count += next();
} while (canBind());
return count ? count : affectedRowCount();
int affectedRows = affectedRowCount();
if (count == 0)
{
if (affectedRows > 0)
return affectedRows;
}
return count;
}