diff --git a/ormpp/mysql.hpp b/ormpp/mysql.hpp index a501577..482d145 100644 --- a/ormpp/mysql.hpp +++ b/ormpp/mysql.hpp @@ -972,7 +972,7 @@ class mysql { int count = (int)mysql_stmt_affected_rows(stmt_); if (count == 0) { - return INT_MIN; + return type == OptType::update ? count : INT_MIN; } return count; diff --git a/ormpp/sqlite.hpp b/ormpp/sqlite.hpp index fb29b0d..02f27ab 100644 --- a/ormpp/sqlite.hpp +++ b/ormpp/sqlite.hpp @@ -535,7 +535,7 @@ class sqlite { int count = sqlite3_changes(handle_); if (count == 0) { - return INT_MIN; + return type == OptType::update ? count : INT_MIN; } return 1;