MySQL: Take mysql_affected_rows returning -1 into account (was not a SELECT statement)

This commit is contained in:
Adrian Imboden 2013-02-22 00:05:21 +01:00
parent 7354622810
commit 453946edcf

View File

@ -118,7 +118,9 @@ void StatementExecutor::execute()
_state = STMT_EXECUTED;
_affectedRowCount = mysql_affected_rows(_pSessionHandle);
my_ulonglong affectedRows = mysql_affected_rows(_pSessionHandle);
if (affectedRows != ((my_ulonglong) - 1))
_affectedRowCount = affectedRows; //Was really a DELETE, UPDATE or INSERT statement
}