MySQL exec now returns the status of the callback

This commit is contained in:
Jaime Melis committed 2017-07-07 17:29:03 +02:00
1 parent d77ecc3df3
commit 822602ca45
1 file changed
+6 -2
+6 -2
View File
@@ -234,7 +234,11 @@ int MySqlDB::exec(ostringstream& cmd, Callbackable* obj, bool quiet)
// Fetch each row, and call-back the object waiting for them
while((row = mysql_fetch_row(result)))
{
obj->do_callback(num_fields, row, names);
if ( obj->do_callback(num_fields, row, names) != 0 )
{
rc = -1;
break;
}
}
// Free the result object
@@ -245,7 +249,7 @@ int MySqlDB::exec(ostringstream& cmd, Callbackable* obj, bool quiet)
free_db_connection(db);
return 0;
return rc;
}
/* -------------------------------------------------------------------------- */