mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-24 22:29:47 +01:00
GH #499: Poco::Data::Statement::execute returns wrong value when zero results (ODBC)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user