handler.cc | handler.cc | |||
---|---|---|---|---|
skipping to change at line 1440 | skipping to change at line 1440 | |||
@post thd->transaction.flags.commit_low == false | @post thd->transaction.flags.commit_low == false | |||
@note This function does not care about global read lock; the caller | @note This function does not care about global read lock; the caller | |||
should. | should. | |||
@param[in] all Is set in case of explicit commit | @param[in] all Is set in case of explicit commit | |||
(COMMIT statement), or implicit commit | (COMMIT statement), or implicit commit | |||
issued by DDL. Is not set when called | issued by DDL. Is not set when called | |||
at the end of statement, even if | at the end of statement, even if | |||
autocommit=1. | autocommit=1. | |||
@param[in] run_after_commit | ||||
True by default, otherwise, does not execute | ||||
the after_commit hook in the function. | ||||
*/ | */ | |||
int ha_commit_low(THD *thd, bool all) | int ha_commit_low(THD *thd, bool all, bool run_after_commit) | |||
{ | { | |||
int error=0; | int error=0; | |||
THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; | THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; | |||
Ha_trx_info *ha_info= trans->ha_list, *ha_info_next; | Ha_trx_info *ha_info= trans->ha_list, *ha_info_next; | |||
DBUG_ENTER("ha_commit_low"); | DBUG_ENTER("ha_commit_low"); | |||
if (ha_info) | if (ha_info) | |||
{ | { | |||
for (; ha_info; ha_info= ha_info_next) | for (; ha_info; ha_info= ha_info_next) | |||
{ | { | |||
skipping to change at line 1478 | skipping to change at line 1481 | |||
{ | { | |||
#ifdef HAVE_QUERY_CACHE | #ifdef HAVE_QUERY_CACHE | |||
if (thd->transaction.changed_tables) | if (thd->transaction.changed_tables) | |||
query_cache.invalidate(thd->transaction.changed_tables); | query_cache.invalidate(thd->transaction.changed_tables); | |||
#endif | #endif | |||
} | } | |||
} | } | |||
/* Free resources and perform other cleanup even for 'empty' transactions . */ | /* Free resources and perform other cleanup even for 'empty' transactions . */ | |||
if (all) | if (all) | |||
thd->transaction.cleanup(); | thd->transaction.cleanup(); | |||
/* If commit succeeded, we call the after_commit hook */ | ||||
if (!error) | ||||
(void) RUN_HOOK(transaction, after_commit, (thd, all)); | ||||
/* | /* | |||
When the transaction has been committed, we clear the commit_low | When the transaction has been committed, we clear the commit_low | |||
flag. This allow other parts of the system to check if commit_low | flag. This allow other parts of the system to check if commit_low | |||
was called. | was called. | |||
*/ | */ | |||
thd->transaction.flags.commit_low= false; | thd->transaction.flags.commit_low= false; | |||
if (run_after_commit) | ||||
{ | ||||
/* If commit succeeded, we call the after_commit hook */ | ||||
if (!error) | ||||
(void) RUN_HOOK(transaction, after_commit, (thd, all)); | ||||
thd->transaction.flags.run_hooks= false; | ||||
} | ||||
DBUG_RETURN(error); | DBUG_RETURN(error); | |||
} | } | |||
int ha_rollback_low(THD *thd, bool all) | int ha_rollback_low(THD *thd, bool all) | |||
{ | { | |||
THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; | THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; | |||
Ha_trx_info *ha_info= trans->ha_list, *ha_info_next; | Ha_trx_info *ha_info= trans->ha_list, *ha_info_next; | |||
int error= 0; | int error= 0; | |||
if (ha_info) | if (ha_info) | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 11 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |