summaryrefslogtreecommitdiff
path: root/innobase/trx/trx0roll.c
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2002-06-22 20:41:14 +0300
committerunknown <heikki@hundin.mysql.fi>2002-06-22 20:41:14 +0300
commit1081513a12851d432103eaabcb6533c84062196c (patch)
treecd94be28879d52101bd7438dc97dc04856d81739 /innobase/trx/trx0roll.c
parentb7b988b3c36fa7a1f0a284d6478bbccbe706c09f (diff)
downloadmariadb-git-1081513a12851d432103eaabcb6533c84062196c.tar.gz
Many files:
Merge 3.23.52 innobase/btr/btr0btr.c: Merge 3.23.52 innobase/btr/btr0cur.c: Merge 3.23.52 innobase/btr/btr0sea.c: Merge 3.23.52 innobase/include/btr0btr.h: Merge 3.23.52 innobase/include/btr0cur.h: Merge 3.23.52 innobase/include/btr0sea.h: Merge 3.23.52 innobase/include/buf0buf.h: Merge 3.23.52 innobase/include/buf0rea.h: Merge 3.23.52 innobase/include/data0data.h: Merge 3.23.52 innobase/include/data0data.ic: Merge 3.23.52 innobase/include/log0log.h: Merge 3.23.52 innobase/include/log0log.ic: Merge 3.23.52 innobase/include/os0file.h: Merge 3.23.52 innobase/include/page0page.h: Merge 3.23.52 innobase/include/page0page.ic: Merge 3.23.52 innobase/include/row0mysql.h: Merge 3.23.52 innobase/include/trx0roll.h: Merge 3.23.52 innobase/include/trx0sys.h: Merge 3.23.52 innobase/include/trx0trx.h: Merge 3.23.52 innobase/include/ut0ut.h: Merge 3.23.52 innobase/include/univ.i: Merge 3.23.52 innobase/include/ut0ut.ic: Merge 3.23.52 innobase/buf/buf0buf.c: Merge 3.23.52 innobase/buf/buf0rea.c: Merge 3.23.52 innobase/data/data0data.c: Merge 3.23.52 innobase/dict/dict0crea.c: Merge 3.23.52 innobase/dict/dict0dict.c: Merge 3.23.52 innobase/dict/dict0load.c: Merge 3.23.52 innobase/dict/dict0mem.c: Merge 3.23.52 innobase/fsp/fsp0fsp.c: Merge 3.23.52 innobase/ibuf/ibuf0ibuf.c: Merge 3.23.52 innobase/lock/lock0lock.c: Merge 3.23.52 innobase/log/log0log.c: Merge 3.23.52 innobase/log/log0recv.c: Merge 3.23.52 innobase/mtr/mtr0log.c: Merge 3.23.52 innobase/mtr/mtr0mtr.c: Merge 3.23.52 innobase/os/os0file.c: Merge 3.23.52 innobase/page/page0cur.c: Merge 3.23.52 innobase/page/page0page.c: Merge 3.23.52 innobase/rem/rem0cmp.c: Merge 3.23.52 innobase/row/row0ins.c: Merge 3.23.52 innobase/row/row0mysql.c: Merge 3.23.52 innobase/row/row0purge.c: Merge 3.23.52 innobase/row/row0upd.c: Merge 3.23.52 innobase/srv/srv0srv.c: Merge 3.23.52 innobase/srv/srv0start.c: Merge 3.23.52 innobase/trx/trx0roll.c: Merge 3.23.52 innobase/trx/trx0sys.c: Merge 3.23.52 innobase/trx/trx0trx.c: Merge 3.23.52 innobase/trx/trx0undo.c: Merge 3.23.52 innobase/ut/ut0mem.c: Merge 3.23.52 innobase/ut/ut0ut.c: Merge 3.23.52
Diffstat (limited to 'innobase/trx/trx0roll.c')
-rw-r--r--innobase/trx/trx0roll.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c
index 47fffea5e40..0a951484b59 100644
--- a/innobase/trx/trx0roll.c
+++ b/innobase/trx/trx0roll.c
@@ -160,11 +160,13 @@ trx_rollback_last_sql_stat_for_mysql(
}
/***********************************************************************
-Rollback uncommitted transactions which have no user session. */
+Rollback or clean up transactions which have no user session. If the
+transaction already was committed, then we clean up a possible insert
+undo log. If the transaction was not yet committed, then we roll it back. */
void
-trx_rollback_all_without_sess(void)
-/*===============================*/
+trx_rollback_or_clean_all_without_sess(void)
+/*========================================*/
{
mem_heap_t* heap;
que_fork_t* fork;
@@ -217,6 +219,19 @@ loop:
trx->sess = trx_dummy_sess;
+ if (trx->conc_state == TRX_COMMITTED_IN_MEMORY) {
+
+ fprintf(stderr, "InnoDB: Cleaning up trx with id %lu %lu\n",
+ ut_dulint_get_high(trx->id),
+ ut_dulint_get_low(trx->id));
+
+ trx_cleanup_at_db_startup(trx);
+
+ mem_heap_free(heap);
+
+ goto loop;
+ }
+
fork = que_fork_create(NULL, NULL, QUE_FORK_RECOVERY, heap);
fork->trx = trx;
@@ -264,9 +279,17 @@ loop:
/* If the transaction was for a dictionary operation, we
drop the relevant table, if it still exists */
+ fprintf(stderr,
+"InnoDB: Dropping table with id %lu %lu in recovery if it exists\n",
+ ut_dulint_get_high(trx->table_id),
+ ut_dulint_get_low(trx->table_id));
+
table = dict_table_get_on_id_low(trx->table_id, trx);
if (table) {
+ fprintf(stderr,
+"InnoDB: Table found: dropping table %s in recovery\n", table->name);
+
err = row_drop_table_for_mysql(table->name, trx,
TRUE);
ut_a(err == (int) DB_SUCCESS);