summaryrefslogtreecommitdiff
path: root/innobase/trx
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-02-11 13:48:59 +0200
committerunknown <monty@hundin.mysql.fi>2002-02-11 13:48:59 +0200
commite0ccdc17a208abb21cf15e7fbbbc3b88b969e0ec (patch)
treeada172b5dc5dccd546e301548aac618812e19814 /innobase/trx
parentaf932b5db200407cb250d6e398383e8db387e680 (diff)
parent501650c5b16a4c7cf7b673b19f9a2ae9c319e24f (diff)
downloadmariadb-git-e0ccdc17a208abb21cf15e7fbbbc3b88b969e0ec.tar.gz
merge with 3.23.48
BUILD/FINISH.sh: Auto merged BUILD/SETUP.sh: Auto merged BUILD/compile-alpha: Auto merged BUILD/compile-pentium-gcov: Auto merged BUILD/compile-pentium-gprof: Auto merged BUILD/compile-pentium: Auto merged BitKeeper/deleted/.del-my_new.cc: Delete: mysys/my_new.cc Build-tools/Do-compile: Auto merged acconfig.h: Auto merged acinclude.m4: Auto merged Docs/manual.texi: Auto merged bdb/dist/configure.in: Auto merged client/Makefile.am: Auto merged innobase/btr/btr0cur.c: Auto merged innobase/buf/buf0lru.c: Auto merged innobase/dict/dict0crea.c: Auto merged innobase/fil/fil0fil.c: Auto merged innobase/include/srv0srv.h: Auto merged innobase/rem/rem0cmp.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/srv/srv0start.c: Auto merged innobase/trx/trx0purge.c: Auto merged myisam/myisampack.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/t/join.test: Auto merged mysys/Makefile.am: Auto merged scripts/Makefile.am: Auto merged sql/ha_innodb.h: Auto merged sql/handler.cc: Auto merged sql/my_lock.c: Auto merged sql/mysqld.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged support-files/my-huge.cnf.sh: Auto merged support-files/my-large.cnf.sh: Auto merged support-files/my-medium.cnf.sh: Auto merged support-files/my-small.cnf.sh: Auto merged configure.in: merge innobase/row/row0mysql.c: merge innobase/trx/trx0trx.c: merge mysql-test/r/innodb.result: merge mysql-test/r/join.result: merge sql/ha_innodb.cc: merge sql/slave.cc: merge
Diffstat (limited to 'innobase/trx')
-rw-r--r--innobase/trx/trx0purge.c4
-rw-r--r--innobase/trx/trx0trx.c52
2 files changed, 52 insertions, 4 deletions
diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c
index 31a0c20ad14..97362d00b4b 100644
--- a/innobase/trx/trx0purge.c
+++ b/innobase/trx/trx0purge.c
@@ -226,9 +226,9 @@ trx_purge_sys_create(void)
value */
purge_sys->sess = sess_open(com_endpoint, (byte*)"purge_system", 13);
- purge_sys->trx = (purge_sys->sess)->trx;
+ purge_sys->trx = purge_sys->sess->trx;
- (purge_sys->trx)->type = TRX_PURGE;
+ purge_sys->trx->type = TRX_PURGE;
ut_a(trx_start_low(purge_sys->trx, ULINT_UNDEFINED));
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index 315bb7030ee..607c80edd09 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -26,9 +26,9 @@ Created 3/26/1996 Heikki Tuuri
/* Copy of the prototype for innobase_mysql_print_thd: this
- copy must be equal to the one in mysql/sql/ha_innobase.cc ! */
-void innobase_mysql_print_thd(void* thd);
+copy must be equal to the one in mysql/sql/ha_innobase.cc ! */
+void innobase_mysql_print_thd(void* thd);
/* Dummy session used currently in MySQL interface */
sess_t* trx_dummy_sess = NULL;
@@ -64,6 +64,8 @@ trx_create(
trx = mem_alloc(sizeof(trx_t));
+ trx->magic_n = TRX_MAGIC_N;
+
trx->op_info = (char *) "";
trx->type = TRX_USER;
@@ -158,6 +160,32 @@ trx_allocate_for_mysql(void)
}
/************************************************************************
+Creates a transaction object for background operations by the master thread. */
+
+trx_t*
+trx_allocate_for_background(void)
+/*=============================*/
+ /* out, own: transaction object */
+{
+ trx_t* trx;
+
+ mutex_enter(&kernel_mutex);
+
+ /* Open a dummy session */
+
+ if (!trx_dummy_sess) {
+ trx_dummy_sess = sess_open(NULL, (byte*)"Dummy sess",
+ ut_strlen("Dummy sess"));
+ }
+
+ trx = trx_create(trx_dummy_sess);
+
+ mutex_exit(&kernel_mutex);
+
+ return(trx);
+}
+
+/************************************************************************
Releases the search latch if trx has reserved it. */
void
@@ -181,6 +209,11 @@ trx_free(
trx_t* trx) /* in, own: trx object */
{
ut_ad(mutex_own(&kernel_mutex));
+
+ ut_a(trx->magic_n == TRX_MAGIC_N);
+
+ trx->magic_n = 11112222;
+
ut_a(trx->conc_state == TRX_NOT_STARTED);
mutex_free(&(trx->undo_mutex));
@@ -242,6 +275,21 @@ trx_free_for_mysql(
mutex_exit(&kernel_mutex);
}
+/************************************************************************
+Frees a transaction object of a background operation of the master thread. */
+
+void
+trx_free_for_background(
+/*====================*/
+ trx_t* trx) /* in, own: trx object */
+{
+ mutex_enter(&kernel_mutex);
+
+ trx_free(trx);
+
+ mutex_exit(&kernel_mutex);
+}
+
/********************************************************************
Inserts the trx handle in the trx system trx list in the right position.
The list is sorted on the trx id so that the biggest id is at the list