66
66
trx_general_rollback_for_mysql(
67
67
/*===========================*/
68
68
trx_t* trx, /*!< in: transaction handle */
69
ibool partial,/*!< in: TRUE if partial rollback requested */
70
69
trx_savept_t* savept) /*!< in: pointer to savepoint undo number, if
71
partial rollback requested */
70
partial rollback requested, or NULL for
145
144
the transaction object does not have an InnoDB session object, and we
146
145
set a dummy session that we use for all MySQL transactions. */
148
err = trx_general_rollback_for_mysql(trx, FALSE, NULL);
147
err = trx_general_rollback_for_mysql(trx, NULL);
150
149
trx->op_info = "";
171
170
trx->op_info = "rollback of SQL statement";
173
err = trx_general_rollback_for_mysql(trx, TRUE,
174
&(trx->last_sql_stat_start));
172
err = trx_general_rollback_for_mysql(trx, &trx->last_sql_stat_start);
175
173
/* The following call should not be needed, but we play safe: */
176
174
trx_mark_sql_stat_end(trx);
283
281
trx->op_info = "rollback to a savepoint";
285
err = trx_general_rollback_for_mysql(trx, TRUE, &(savep->savept));
283
err = trx_general_rollback_for_mysql(trx, &savep->savept);
287
285
/* Store the current undo_no of the transaction so that we know where
288
286
to roll back if we have to roll back the next SQL statement: */
534
532
Rollback or clean up any incomplete transactions which were
535
533
encountered in crash recovery. If the transaction already was
536
534
committed, then we clean up a possible insert undo log. If the
537
transaction was not yet committed, then we roll it back.
538
Note: this is done in a background thread.
539
@return a dummy parameter */
535
transaction was not yet committed, then we roll it back. */
542
trx_rollback_or_clean_all_recovered(
543
/*================================*/
544
void* arg __attribute__((unused)))
545
/*!< in: a dummy parameter required by
538
trx_rollback_or_clean_recovered(
539
/*============================*/
540
ibool all) /*!< in: FALSE=roll back dictionary transactions;
541
TRUE=roll back all non-PREPARED transactions */
550
545
mutex_enter(&kernel_mutex);
552
if (UT_LIST_GET_FIRST(trx_sys->trx_list)) {
547
if (!UT_LIST_GET_FIRST(trx_sys->trx_list)) {
555
553
"InnoDB: Starting in background the rollback"
556
554
" of uncommitted transactions\n");
561
557
mutex_exit(&kernel_mutex);
587
mutex_exit(&kernel_mutex);
588
trx_rollback_active(trx);
583
if (all || trx_get_dict_operation(trx)
584
!= TRX_DICT_OP_NONE) {
585
mutex_exit(&kernel_mutex);
586
trx_rollback_active(trx);
593
ut_print_timestamp(stderr);
595
" InnoDB: Rollback of non-prepared transactions completed\n");
593
ut_print_timestamp(stderr);
595
" InnoDB: Rollback of non-prepared"
596
" transactions completed\n");
598
600
mutex_exit(&kernel_mutex);
603
/*******************************************************************//**
604
Rollback or clean up any incomplete transactions which were
605
encountered in crash recovery. If the transaction already was
606
committed, then we clean up a possible insert undo log. If the
607
transaction was not yet committed, then we roll it back.
608
Note: this is done in a background thread.
609
@return a dummy parameter */
612
trx_rollback_or_clean_all_recovered(
613
/*================================*/
614
void* arg __attribute__((unused)))
615
/*!< in: a dummy parameter required by
618
trx_rollback_or_clean_recovered(TRUE);
600
620
/* We count the number of threads in os_thread_exit(). A created
601
621
thread should always use that to exit and not use return() to exit. */