The problem was that the slow_extended patch changed mysql_execute_command() so that thd->row_count is unconditionally reset to 1 before statement execution. This could lead to incorrectly reported row numbers in warning or error messages for stored routines.
The reason for resetting row_count in slow_extended.patch is that we would like to see separate stats for individual statements in stored routines. The solution is to remember the row_count value at the start of a statement execution instead of resetting it. This way we can calculate the number of rows corresponding to the last statement by subtracting the original value from the current one.
Since the regression tests for slow_extended were broken on Mac OS X, they were also fixed as a part of this bugfix.