);
}
+ std::vector<IdoMysqlResultInfo> resultSets;
+
for (std::vector<IdoAsyncQuery>::size_type i = offset; i < offset + count; i++) {
const IdoAsyncQuery& aq = queries[i];
MYSQL_RES *result = mysql_store_result(&m_Connection);
- m_AffectedRows = mysql_affected_rows(&m_Connection);
-
+ int affectedRows = mysql_affected_rows(&m_Connection);
IdoMysqlResult iresult;
if (!result) {
if (mysql_field_count(&m_Connection) > 0) {
std::ostringstream msgbuf;
String message = mysql_error(&m_Connection);
- msgbuf << "Error \"" << message << "\" when executing query \"" << aq.Query << "\"";
+ msgbuf << "Error \"" << message << "\" when checking field count \"" << aq.Query << "\"";
Log(LogCritical, "IdoMysqlConnection", msgbuf.str());
BOOST_THROW_EXCEPTION(
} else
iresult = IdoMysqlResult(result, std::ptr_fun(mysql_free_result));
- if (aq.Callback)
- aq.Callback(iresult);
+ IdoMysqlResultInfo resultInfo;
+ resultInfo.Result = iresult;
+ resultInfo.AffectedRows = affectedRows;
+
+ resultSets.push_back(resultInfo);
if (mysql_next_result(&m_Connection) > 0) {
std::ostringstream msgbuf;
}
}
+ for (std::vector<IdoAsyncQuery>::size_type i = offset; i < offset + count; i++) {
+ const IdoAsyncQuery& aq = queries[i];
+
+ const IdoMysqlResultInfo ri = resultSets[i - offset];
+
+ m_AffectedRows = ri.AffectedRows;
+
+ if (aq.Callback)
+ aq.Callback(ri.Result);
+ }
+
offset += count;
}
}