* He Zhenxing <hezx@stripped> [08/06/27 13:59]:
> /* If commit fails, we should be able to reset the OK status. */
> thd->main_da.can_overwrite_status= TRUE;
> - ha_autocommit_or_rollback(thd, thd->is_error());
> + if (thd->transaction.stmt.ha_list)
> + {
> + ha_autocommit_or_rollback(thd, thd->is_error());
> + }
> + else
> + {
> + if (!thd->is_error())
> + RUN_HOOK(transaction, after_commit, (thd, 0));
> + else
> + RUN_HOOK(transaction, after_rollback, (thd, 0));
> + }
> thd->main_da.can_overwrite_status= FALSE;
Please leave the dispatch_command as is.
ha_autocommit_or_rollback is called from an awful lot of places.
If you need to be running any hooks, you need to be running them
from within ha_autocommit_or_rollback().
--