From 453946edcfc8aea77752bde97f89fce2e68b985c Mon Sep 17 00:00:00 2001 From: Adrian Imboden Date: Fri, 22 Feb 2013 00:05:21 +0100 Subject: [PATCH] MySQL: Take mysql_affected_rows returning -1 into account (was not a SELECT statement) --- Data/MySQL/src/StatementExecutor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Data/MySQL/src/StatementExecutor.cpp b/Data/MySQL/src/StatementExecutor.cpp index 5619e04b7..3a6ab77d3 100644 --- a/Data/MySQL/src/StatementExecutor.cpp +++ b/Data/MySQL/src/StatementExecutor.cpp @@ -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 }