summaryrefslogtreecommitdiff
path: root/innobase/trx/trx0trx.c
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/trx/trx0trx.c')
-rw-r--r--innobase/trx/trx0trx.c49
1 files changed, 29 insertions, 20 deletions
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index 10fbf3468c0..078befb81d2 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -30,8 +30,9 @@ Created 3/26/1996 Heikki Tuuri
copy MUST be equal to the one in mysql/sql/ha_innodb.cc ! */
void innobase_mysql_print_thd(
- FILE* f,
- void* thd);
+ FILE* f,
+ void* thd,
+ uint max_query_len);
/* Dummy session used currently in MySQL interface */
sess_t* trx_dummy_sess = NULL;
@@ -159,7 +160,8 @@ trx_create(
trx->auto_inc_lock = NULL;
- trx->read_view_heap = mem_heap_create(256);
+ trx->global_read_view_heap = mem_heap_create(256);
+ trx->global_read_view = NULL;
trx->read_view = NULL;
/* Set X/Open XA transaction identification to NULL */
@@ -261,7 +263,7 @@ trx_free(
fputs(
" InnoDB: Error: Freeing a trx which is declared to be processing\n"
"InnoDB: inside InnoDB.\n", stderr);
- trx_print(stderr, trx);
+ trx_print(stderr, trx, 600);
putc('\n', stderr);
}
@@ -276,7 +278,7 @@ trx_free(
(ulong)trx->n_mysql_tables_in_use,
(ulong)trx->mysql_n_tables_locked);
- trx_print(stderr, trx);
+ trx_print(stderr, trx, 600);
ut_print_buf(stderr, (byte*)trx, sizeof(trx_t));
}
@@ -318,10 +320,12 @@ trx_free(
ut_a(UT_LIST_GET_LEN(trx->trx_locks) == 0);
- if (trx->read_view_heap) {
- mem_heap_free(trx->read_view_heap);
+ if (trx->global_read_view_heap) {
+ mem_heap_free(trx->global_read_view_heap);
}
+ trx->global_read_view = NULL;
+
ut_a(trx->read_view == NULL);
mem_free(trx);
@@ -830,13 +834,14 @@ trx_commit_off_kernel(
lock_release_off_kernel(trx);
- if (trx->read_view) {
- read_view_close(trx->read_view);
-
- mem_heap_empty(trx->read_view_heap);
- trx->read_view = NULL;
+ if (trx->global_read_view) {
+ read_view_close(trx->global_read_view);
+ mem_heap_empty(trx->global_read_view_heap);
+ trx->global_read_view = NULL;
}
+ trx->read_view = NULL;
+
if (must_flush_log) {
mutex_exit(&kernel_mutex);
@@ -964,7 +969,9 @@ trx_assign_read_view(
mutex_enter(&kernel_mutex);
if (!trx->read_view) {
- trx->read_view = read_view_open_now(trx, trx->read_view_heap);
+ trx->read_view = read_view_open_now(trx,
+ trx->global_read_view_heap);
+ trx->global_read_view = trx->read_view;
}
mutex_exit(&kernel_mutex);
@@ -1645,16 +1652,18 @@ trx_mark_sql_stat_end(
}
/**************************************************************************
-Prints info about a transaction to the standard output. The caller must
-own the kernel mutex and must have called
-innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL or
-InnoDB cannot meanwhile change the info printed here. */
+Prints info about a transaction to the given file. The caller must own the
+kernel mutex and must have called
+innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL
+or InnoDB cannot meanwhile change the info printed here. */
void
trx_print(
/*======*/
- FILE* f, /* in: output stream */
- trx_t* trx) /* in: transaction */
+ FILE* f, /* in: output stream */
+ trx_t* trx, /* in: transaction */
+ uint max_query_len) /* in: max query length to print, or 0 to
+ use the default max length */
{
ibool newline;
@@ -1749,7 +1758,7 @@ trx_print(
}
if (trx->mysql_thd != NULL) {
- innobase_mysql_print_thd(f, trx->mysql_thd);
+ innobase_mysql_print_thd(f, trx->mysql_thd, max_query_len);
}
}