1
0
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:
Michael Widenius
2017-07-29 10:35:30 +03:00
committed by Sergei Golubchik
parent 4be15fe065
commit 94bbe8ad58
6 changed files with 65 additions and 12 deletions

View File

@ -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;
}