mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Affected rows for a SP now includes affected rows for all statements
The old behavior of returning the affected rows for the last statement in a stored procedure was more an accident than design. Having the number of affected rows for all sub statements is more useful and will not change just because on changes the order of statements in the stored procedure.
This commit is contained in:
committed by
Sergei Golubchik
parent
4be15fe065
commit
94bbe8ad58
@ -2919,8 +2919,7 @@ static bool do_execute_sp(THD *thd, sp_head *sp)
|
||||
|
||||
affected_rows= thd->affected_rows; // Affected rows for all sub statements
|
||||
thd->affected_rows= 0; // Reset total, as my_ok() adds to it
|
||||
my_ok(thd, (thd->get_row_count_func() < 0) ? 0 : thd->get_row_count_func());
|
||||
thd->affected_rows= affected_rows; // Restore original value
|
||||
my_ok(thd, affected_rows);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user