summaryrefslogtreecommitdiff
path: root/innobase/include
diff options
context:
space:
mode:
authorunknown <heikki@donna.mysql.fi>2002-01-28 22:18:49 +0200
committerunknown <heikki@donna.mysql.fi>2002-01-28 22:18:49 +0200
commitac540e96a915c30034a4fc03ef65b60b8392f664 (patch)
treeaa7f771761883b28925048ff5e37e2eb85d77c00 /innobase/include
parent2aa572433b9ce47a511958ce263c8400c2e81ac3 (diff)
downloadmariadb-git-ac540e96a915c30034a4fc03ef65b60b8392f664.tar.gz
Many files:
Merge InnoDB-.48 sql/ha_innobase.cc: Merge InnoDB-.48 innobase/include/dict0dict.h: Merge InnoDB-.48 innobase/include/dict0mem.h: Merge InnoDB-.48 innobase/include/mem0dbg.h: Merge InnoDB-.48 innobase/include/mem0mem.h: Merge InnoDB-.48 innobase/include/que0que.h: Merge InnoDB-.48 innobase/include/row0mysql.h: Merge InnoDB-.48 innobase/include/srv0srv.h: Merge InnoDB-.48 innobase/include/trx0sys.h: Merge InnoDB-.48 innobase/include/trx0trx.h: Merge InnoDB-.48 innobase/include/mem0mem.ic: Merge InnoDB-.48 innobase/dict/dict0dict.c: Merge InnoDB-.48 innobase/dict/dict0mem.c: Merge InnoDB-.48 innobase/log/log0recv.c: Merge InnoDB-.48 innobase/mem/mem0dbg.c: Merge InnoDB-.48 innobase/mem/mem0mem.c: Merge InnoDB-.48 innobase/pars/lexyy.c: Merge InnoDB-.48 innobase/que/que0que.c: Merge InnoDB-.48 innobase/rem/rem0rec.c: Merge InnoDB-.48 innobase/row/row0mysql.c: Merge InnoDB-.48 innobase/row/row0sel.c: Merge InnoDB-.48 innobase/srv/srv0srv.c: Merge InnoDB-.48 innobase/sync/sync0arr.c: Merge InnoDB-.48 innobase/trx/trx0sys.c: Merge InnoDB-.48 innobase/trx/trx0trx.c: Merge InnoDB-.48 innobase/trx/trx0undo.c: Merge InnoDB-.48
Diffstat (limited to 'innobase/include')
-rw-r--r--innobase/include/dict0dict.h14
-rw-r--r--innobase/include/dict0mem.h6
-rw-r--r--innobase/include/mem0dbg.h14
-rw-r--r--innobase/include/mem0mem.h97
-rw-r--r--innobase/include/mem0mem.ic57
-rw-r--r--innobase/include/que0que.h5
-rw-r--r--innobase/include/row0mysql.h7
-rw-r--r--innobase/include/srv0srv.h26
-rw-r--r--innobase/include/trx0sys.h35
-rw-r--r--innobase/include/trx0trx.h22
10 files changed, 180 insertions, 103 deletions
diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h
index ae313398c99..79d67ecae15 100644
--- a/innobase/include/dict0dict.h
+++ b/innobase/include/dict0dict.h
@@ -26,6 +26,20 @@ Created 1/8/1996 Heikki Tuuri
#include "ut0byte.h"
#include "trx0types.h"
+/************************************************************************
+Increments the count of open MySQL handles to a table. */
+
+void
+dict_table_increment_handle_count(
+/*==============================*/
+ dict_table_t* table); /* in: table */
+/************************************************************************
+Decrements the count of open MySQL handles to a table. */
+
+void
+dict_table_decrement_handle_count(
+/*==============================*/
+ dict_table_t* table); /* in: table */
/**************************************************************************
Inits the data dictionary module. */
diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h
index 2f00ccfcf32..5ef0103087a 100644
--- a/innobase/include/dict0mem.h
+++ b/innobase/include/dict0mem.h
@@ -307,6 +307,12 @@ struct dict_table_struct{
ulint mem_fix;/* count of how many times the table
and its indexes has been fixed in memory;
currently NOT used */
+ ulint n_mysql_handles_opened;
+ /* count of how many handles MySQL has opened
+ to this table; dropping of the table is
+ NOT allowed until this count gets to zero;
+ MySQL does NOT itself check the number of
+ open handles at drop */
ibool cached; /* TRUE if the table object has been added
to the dictionary cache */
lock_t* auto_inc_lock;/* a buffer for an auto-inc lock
diff --git a/innobase/include/mem0dbg.h b/innobase/include/mem0dbg.h
index dda37626198..0b1aa53d694 100644
--- a/innobase/include/mem0dbg.h
+++ b/innobase/include/mem0dbg.h
@@ -10,11 +10,14 @@ Created 6/9/1994 Heikki Tuuri
/* In the debug version each allocated field is surrounded with
check fields whose sizes are given below */
+#ifdef UNIV_MEM_DEBUG
#define MEM_FIELD_HEADER_SIZE ut_calc_align(2 * sizeof(ulint),\
UNIV_MEM_ALIGNMENT)
#define MEM_FIELD_TRAILER_SIZE sizeof(ulint)
+#else
+#define MEM_FIELD_HEADER_SIZE 0
+#endif
-#define MEM_BLOCK_MAGIC_N 764741
/* Space needed when allocating for a user a field of
length N. The space is allocated only in multiples of
@@ -115,3 +118,12 @@ ibool
mem_validate(void);
/*===============*/
/* out: TRUE if ok */
+/****************************************************************
+Tries to find neigboring memory allocation blocks and dumps to stderr
+the neighborhood of a given pointer. */
+
+void
+mem_analyze_corruption(
+/*===================*/
+ byte* ptr); /* in: pointer to place of possible corruption */
+
diff --git a/innobase/include/mem0mem.h b/innobase/include/mem0mem.h
index 95024cf8011..57fac93d3ac 100644
--- a/innobase/include/mem0mem.h
+++ b/innobase/include/mem0mem.h
@@ -61,58 +61,41 @@ mem_init(
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap creation. */
-#ifdef UNIV_MEM_DEBUG
+
#define mem_heap_create(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_DYNAMIC,\
IB__FILE__, __LINE__)
-#else
-#define mem_heap_create(N) mem_heap_create_func(N, NULL, MEM_HEAP_DYNAMIC)
-#endif
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap creation. */
-#ifdef UNIV_MEM_DEBUG
+
#define mem_heap_create_in_buffer(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_BUFFER,\
IB__FILE__, __LINE__)
-#else
-#define mem_heap_create_in_buffer(N) mem_heap_create_func(N, NULL,\
- MEM_HEAP_BUFFER)
-#endif
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap creation. */
-#ifdef UNIV_MEM_DEBUG
+
#define mem_heap_create_in_btr_search(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_BTR_SEARCH |\
MEM_HEAP_BUFFER,\
IB__FILE__, __LINE__)
-#else
-#define mem_heap_create_in_btr_search(N) mem_heap_create_func(N, NULL,\
- MEM_HEAP_BTR_SEARCH | MEM_HEAP_BUFFER)
-#endif
/******************************************************************
Use this macro instead of the corresponding function! Macro for fast
memory heap creation. An initial block of memory B is given by the
caller, N is its size, and this memory block is not freed by
mem_heap_free. See the parameter comment in mem_heap_create_func below. */
-#ifdef UNIV_MEM_DEBUG
+
#define mem_heap_fast_create(N, B) mem_heap_create_func(\
(N), (B), MEM_HEAP_DYNAMIC,\
IB__FILE__, __LINE__)
-#else
-#define mem_heap_fast_create(N, B) mem_heap_create_func(N, (B),\
- MEM_HEAP_DYNAMIC)
-#endif
+
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap freeing. */
-#ifdef UNIV_MEM_DEBUG
+
#define mem_heap_free(heap) mem_heap_free_func(\
(heap), IB__FILE__, __LINE__)
-#else
-#define mem_heap_free(heap) mem_heap_free_func(heap)
-#endif
/*********************************************************************
NOTE: Use the corresponding macros instead of this function. Creates a
memory heap which allocates memory from dynamic space. For debugging
@@ -139,11 +122,9 @@ mem_heap_create_func(
block is not unintentionally erased
(if allocated in the stack), before
the memory heap is explicitly freed. */
- ulint type /* in: MEM_HEAP_DYNAMIC or MEM_HEAP_BUFFER */
- #ifdef UNIV_MEM_DEBUG
- ,char* file_name, /* in: file name where created */
+ ulint type, /* in: MEM_HEAP_DYNAMIC or MEM_HEAP_BUFFER */
+ char* file_name, /* in: file name where created */
ulint line /* in: line where created */
- #endif
);
/*********************************************************************
NOTE: Use the corresponding macro instead of this function.
@@ -152,11 +133,9 @@ UNIV_INLINE
void
mem_heap_free_func(
/*===============*/
- mem_heap_t* heap /* in, own: heap to be freed */
- #ifdef UNIV_MEM_DEBUG
- ,char* file_name, /* in: file name where freed */
- ulint line /* in: line where freed */
- #endif
+ mem_heap_t* heap, /* in, own: heap to be freed */
+ char* file_name, /* in: file name where freed */
+ ulint line /* in: line where freed */
);
/*******************************************************************
Allocates n bytes of memory from a memory heap. */
@@ -220,25 +199,18 @@ UNIV_INLINE
ulint
mem_heap_get_size(
/*==============*/
- mem_heap_t* heap); /* in: heap */
+ mem_heap_t* heap); /* in: heap */
/******************************************************************
Use this macro instead of the corresponding function!
Macro for memory buffer allocation */
-#ifdef UNIV_MEM_DEBUG
-#define mem_alloc(N) mem_alloc_func(\
- (N), IB__FILE__, __LINE__)
-#else
-#define mem_alloc(N) mem_alloc_func(N)
-#endif
+
+#define mem_alloc(N) mem_alloc_func((N), IB__FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function!
Macro for memory buffer allocation */
-#ifdef UNIV_MEM_DEBUG
+
#define mem_alloc_noninline(N) mem_alloc_func_noninline(\
(N), IB__FILE__, __LINE__)
-#else
-#define mem_alloc_noninline(N) mem_alloc_func_noninline(N)
-#endif
/*******************************************************************
NOTE: Use the corresponding macro instead of this function.
Allocates a single buffer of memory from the dynamic memory of
@@ -250,11 +222,9 @@ mem_alloc_func(
/*===========*/
/* out, own: free storage, NULL
if did not succeed */
- ulint n /* in: desired number of bytes */
- #ifdef UNIV_MEM_DEBUG
- ,char* file_name, /* in: file name where created */
- ulint line /* in: line where created */
- #endif
+ ulint n, /* in: desired number of bytes */
+ char* file_name, /* in: file name where created */
+ ulint line /* in: line where created */
);
/*******************************************************************
NOTE: Use the corresponding macro instead of this function.
@@ -267,21 +237,15 @@ mem_alloc_func_noninline(
/*=====================*/
/* out, own: free storage, NULL if did not
succeed */
- ulint n /* in: desired number of bytes */
- #ifdef UNIV_MEM_DEBUG
- ,char* file_name, /* in: file name where created */
+ ulint n, /* in: desired number of bytes */
+ char* file_name, /* in: file name where created */
ulint line /* in: line where created */
- #endif
);
/******************************************************************
Use this macro instead of the corresponding function!
Macro for memory buffer freeing */
-#ifdef UNIV_MEM_DEBUG
-#define mem_free(PTR) mem_free_func(\
- (PTR), IB__FILE__, __LINE__)
-#else
-#define mem_free(PTR) mem_free_func(PTR)
-#endif
+
+#define mem_free(PTR) mem_free_func((PTR), IB__FILE__, __LINE__)
/*******************************************************************
NOTE: Use the corresponding macro instead of this function.
Frees a single buffer of storage from
@@ -290,11 +254,9 @@ UNIV_INLINE
void
mem_free_func(
/*==========*/
- void* ptr /* in, own: buffer to be freed */
- #ifdef UNIV_MEM_DEBUG
- ,char* file_name, /* in: file name where created */
- ulint line /* in: line where created */
- #endif
+ void* ptr, /* in, own: buffer to be freed */
+ char* file_name, /* in: file name where created */
+ ulint line /* in: line where created */
);
/*******************************************************************
Implements realloc. */
@@ -304,7 +266,9 @@ mem_realloc(
/*========*/
/* out, own: free storage, NULL if did not succeed */
void* buf, /* in: pointer to an old buffer */
- ulint n); /* in: desired number of bytes */
+ ulint n, /* in: desired number of bytes */
+ char* file_name,/* in: file name where called */
+ ulint line); /* in: line where called */
/*#######################################################################*/
@@ -336,8 +300,13 @@ struct mem_block_info_struct {
free block to the heap, if we need more space;
otherwise, this is NULL */
ulint magic_n;/* magic number for debugging */
+ char file_name[8];/* file name where the mem heap was created */
+ ulint line; /* line number where the mem heap was created */
};
+#define MEM_BLOCK_MAGIC_N 764741555
+#define MEM_FREED_BLOCK_MAGIC_N 547711122
+
/* Header size for a memory heap block */
#define MEM_BLOCK_HEADER_SIZE ut_calc_align(sizeof(mem_block_info_t),\
UNIV_MEM_ALIGNMENT)
diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic
index edc3ab17f2a..a7abb93d91d 100644
--- a/innobase/include/mem0mem.ic
+++ b/innobase/include/mem0mem.ic
@@ -24,8 +24,10 @@ mem_heap_create_block(
if init_block is not NULL, its size in bytes */
void* init_block, /* in: init block in fast create, type must be
MEM_HEAP_DYNAMIC */
- ulint type); /* in: type of heap: MEM_HEAP_DYNAMIC or
+ ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or
MEM_HEAP_BUFFER */
+ char* file_name,/* in: file name where created */
+ ulint line); /* in: line where created */
/**********************************************************************
Frees a block from a memory heap. */
@@ -392,21 +394,20 @@ mem_heap_create_func(
block is not unintentionally erased
(if allocated in the stack), before
the memory heap is explicitly freed. */
- ulint type /* in: MEM_HEAP_DYNAMIC, or MEM_HEAP_BUFFER
+ ulint type, /* in: MEM_HEAP_DYNAMIC, or MEM_HEAP_BUFFER
possibly ORed to MEM_HEAP_BTR_SEARCH */
- #ifdef UNIV_MEM_DEBUG
- ,char* file_name, /* in: file name where created */
+ char* file_name, /* in: file name where created */
ulint line /* in: line where created */
- #endif
)
{
mem_block_t* block;
if (n > 0) {
- block = mem_heap_create_block(NULL, n, init_block, type);
+ block = mem_heap_create_block(NULL, n, init_block, type,
+ file_name, line);
} else {
block = mem_heap_create_block(NULL, MEM_BLOCK_START_SIZE,
- init_block, type);
+ init_block, type, file_name, line);
}
ut_ad(block);
@@ -438,11 +439,9 @@ UNIV_INLINE
void
mem_heap_free_func(
/*===============*/
- mem_heap_t* heap /* in, own: heap to be freed */
- #ifdef UNIV_MEM_DEBUG
- ,char* file_name, /* in: file name where freed */
+ mem_heap_t* heap, /* in, own: heap to be freed */
+ char* file_name, /* in: file name where freed */
ulint line /* in: line where freed */
- #endif
)
{
mem_block_t* block;
@@ -488,14 +487,12 @@ mem_alloc_func(
/*===========*/
/* out, own: free storage, NULL if did not
succeed */
- ulint n /* in: desired number of bytes */
- #ifdef UNIV_MEM_DEBUG
- ,char* file_name, /* in: file name where created */
+ ulint n, /* in: desired number of bytes */
+ char* file_name, /* in: file name where created */
ulint line /* in: line where created */
- #endif
)
{
- #ifndef UNIV_MEM_DEBUG
+#ifdef notdefined
void* buf;
buf = mem_area_alloc(n, mem_comm_pool);
@@ -505,7 +502,7 @@ mem_alloc_func(
#endif
return(buf);
- #else
+#else
mem_heap_t* heap;
void* buf;
@@ -524,11 +521,11 @@ mem_alloc_func(
buf = mem_heap_alloc(heap, n);
- ut_ad((byte*)heap == (byte*)buf - MEM_BLOCK_HEADER_SIZE
+ ut_a((byte*)heap == (byte*)buf - MEM_BLOCK_HEADER_SIZE
- MEM_FIELD_HEADER_SIZE);
return(buf);
- #endif
+#endif
}
/*******************************************************************
@@ -539,26 +536,22 @@ UNIV_INLINE
void
mem_free_func(
/*==========*/
- void* ptr /* in, own: buffer to be freed */
- #ifdef UNIV_MEM_DEBUG
- ,char* file_name, /* in: file name where created */
+ void* ptr, /* in, own: buffer to be freed */
+ char* file_name, /* in: file name where created */
ulint line /* in: line where created */
- #endif
)
{
- #ifndef UNIV_MEM_DEBUG
+#ifdef notdefined
mem_area_free(ptr, mem_comm_pool);
- #else
-
+#else
mem_heap_t* heap;
heap = (mem_heap_t*)((byte*)ptr - MEM_BLOCK_HEADER_SIZE
- MEM_FIELD_HEADER_SIZE);
mem_heap_free_func(heap, file_name, line);
-
- #endif
+#endif
}
/*********************************************************************
@@ -567,7 +560,7 @@ UNIV_INLINE
ulint
mem_heap_get_size(
/*==============*/
- mem_heap_t* heap) /* in: heap */
+ mem_heap_t* heap) /* in: heap */
{
mem_block_t* block;
ulint size = 0;
@@ -597,9 +590,11 @@ mem_realloc(
/*========*/
/* out, own: free storage, NULL if did not succeed */
void* buf, /* in: pointer to an old buffer */
- ulint n) /* in: desired number of bytes */
+ ulint n, /* in: desired number of bytes */
+ char* file_name,/* in: file name where called */
+ ulint line) /* in: line where called */
{
mem_free(buf);
- return(mem_alloc(n));
+ return(mem_alloc_func(n, file_name, line));
}
diff --git a/innobase/include/que0que.h b/innobase/include/que0que.h
index 4cbd888ba1d..cdaeeae1fde 100644
--- a/innobase/include/que0que.h
+++ b/innobase/include/que0que.h
@@ -327,6 +327,8 @@ mutex with the exceptions named below */
struct que_thr_struct{
que_common_t common; /* type: QUE_NODE_THR */
+ ulint magic_n; /* magic number to catch memory
+ corruption */
que_node_t* child; /* graph child node */
que_t* graph; /* graph where this node belongs */
ibool is_active; /* TRUE if the thread has been set
@@ -357,6 +359,9 @@ struct que_thr_struct{
thus far */
};
+#define QUE_THR_MAGIC_N 8476583
+#define QUE_THR_MAGIC_FREED 123461526
+
/* Query graph fork node: its fields are protected by the kernel mutex */
struct que_fork_struct{
que_common_t common; /* type: QUE_NODE_FORK */
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index 32354219e64..0346299bb10 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -323,11 +323,18 @@ struct mysql_row_templ_struct {
/* After fetching this many rows, we start caching them in fetch_cache */
#define MYSQL_FETCH_CACHE_THRESHOLD 4
+#define ROW_PREBUILT_ALLOCATED 78540783
+#define ROW_PREBUILT_FREED 26423527
/* A struct for (sometimes lazily) prebuilt structures in an Innobase table
handle used within MySQL; these are used to save CPU time. */
struct row_prebuilt_struct {
+ ulint magic_n; /* this magic number is set to
+ ROW_PREBUILT_ALLOCATED when created
+ and to ROW_PREBUILT_FREED when the
+ struct has been freed; used in
+ debugging */
dict_table_t* table; /* Innobase table handle */
trx_t* trx; /* current transaction handle */
ibool sql_stat_start; /* TRUE when we start processing of
diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h
index 1a37460569b..05989c6410e 100644
--- a/innobase/include/srv0srv.h
+++ b/innobase/include/srv0srv.h
@@ -17,6 +17,8 @@ Created 10/10/1995 Heikki Tuuri
#include "que0types.h"
#include "trx0types.h"
+/* Buffer which can be used in printing fatal error messages */
+extern char srv_fatal_errbuf[];
/* When this event is set the lock timeout and InnoDB monitor
thread starts running */
@@ -261,15 +263,27 @@ This lets a thread enter InnoDB regardless of the number of threads inside
InnoDB. This must be called when a thread ends a lock wait. */
void
-srv_conc_force_enter_innodb(void);
-/*=============================*/
+srv_conc_force_enter_innodb(
+/*========================*/
+ trx_t* trx); /* in: transaction object associated with the
+ thread */
/*************************************************************************
-This must be called when a thread exits InnoDB. This must also be called
-when a thread goes to wait for a lock. */
+This must be called when a thread exits InnoDB in a lock wait or at the
+end of an SQL statement. */
void
-srv_conc_exit_innodb(void);
-/*======================*/
+srv_conc_force_exit_innodb(
+/*=======================*/
+ trx_t* trx); /* in: transaction object associated with the
+ thread */
+/*************************************************************************
+This must be called when a thread exits InnoDB. */
+
+void
+srv_conc_exit_innodb(
+/*=================*/
+ trx_t* trx); /* in: transaction object associated with the
+ thread */
/*******************************************************************
Puts a MySQL OS thread to wait for a lock to be released. */
diff --git a/innobase/include/trx0sys.h b/innobase/include/trx0sys.h
index 0295cd6abff..f2eded697ec 100644
--- a/innobase/include/trx0sys.h
+++ b/innobase/include/trx0sys.h
@@ -218,6 +218,22 @@ trx_in_trx_list(
/*============*/
/* out: TRUE if is in */
trx_t* in_trx);/* in: trx */
+/*********************************************************************
+Updates the offset information about the end of the MySQL binlog entry
+which corresponds to the transaction just being committed. */
+
+void
+trx_sys_update_mysql_binlog_offset(
+/*===============================*/
+ trx_t* trx, /* in: transaction being committed */
+ mtr_t* mtr); /* in: mtr */
+/*********************************************************************
+Prints to stderr the MySQL binlog offset info in the trx system header if
+the magic number shows it valid. */
+
+void
+trx_sys_print_mysql_binlog_offset(void);
+/*===================================*/
/* The automatically created system rollback segment has this id */
#define TRX_SYS_SYSTEM_RSEG_ID 0
@@ -236,7 +252,7 @@ therefore 256 */
/* Transaction system header; protected by trx_sys->mutex */
/*-------------------------------------------------------------*/
-#define TRX_SYS_TRX_ID_STORE 0 /* The maximum trx id or trx number
+#define TRX_SYS_TRX_ID_STORE 0 /* the maximum trx id or trx number
modulo TRX_SYS_TRX_ID_UPDATE_MARGIN
written to a file page by any
transaction; the assignment of
@@ -252,6 +268,23 @@ therefore 256 */
segment specification slots */
/*-------------------------------------------------------------*/
+#define TRX_SYS_MYSQL_LOG_NAME_LEN 32
+#define TRX_SYS_MYSQL_LOG_MAGIC_N 873422344
+
+/* The offset of the MySQL binlog offset info on the trx system header page */
+#define TRX_SYS_MYSQL_LOG_INFO (UNIV_PAGE_SIZE - 300)
+#define TRX_SYS_MYSQL_LOG_MAGIC_N_FLD 0 /* magic number which shows
+ if we have valid data in the
+ MySQL binlog info; the value
+ is ..._MAGIC_N if yes */
+#define TRX_SYS_MYSQL_LOG_NAME 4 /* MySQL log file name */
+#define TRX_SYS_MYSQL_LOG_OFFSET_HIGH (4 + TRX_SYS_MYSQL_LOG_NAME_LEN)
+ /* high 4 bytes of the offset
+ within that file */
+#define TRX_SYS_MYSQL_LOG_OFFSET_LOW (8 + TRX_SYS_MYSQL_LOG_NAME_LEN)
+ /* low 4 bytes of the offset
+ within that file */
+
/* The offset of the doublewrite buffer header on the trx system header page */
#define TRX_SYS_DOUBLEWRITE (UNIV_PAGE_SIZE - 200)
/*-------------------------------------------------------------*/
diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h
index 58cef01b376..d67628b8bad 100644
--- a/innobase/include/trx0trx.h
+++ b/innobase/include/trx0trx.h
@@ -290,10 +290,20 @@ struct trx_struct{
table */
dulint table_id; /* table id if the preceding field is
TRUE */
+ /*------------------------------*/
void* mysql_thd; /* MySQL thread handle corresponding
to this trx, or NULL */
+ char* mysql_log_file_name;
+ /* If MySQL binlog is used, this field
+ contains a pointer to the latest file
+ name; this is NULL if binlog is not
+ used */
+ ib_longlong mysql_log_offset;/* If MySQL binlog is used, this field
+ contains the end offset of the binlog
+ entry */
os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated
with this transaction object */
+ /*------------------------------*/
ulint n_mysql_tables_in_use; /* number of Innobase tables
used in the processing of the current
SQL statement in MySQL */
@@ -314,6 +324,18 @@ struct trx_struct{
calls from MySQL; this is intended
to reduce contention on the search
latch */
+ /*------------------------------*/
+ ibool declared_to_be_inside_innodb;
+ /* this is TRUE if we have declared
+ this transaction in
+ srv_conc_enter_innodb to be inside the
+ InnoDB engine */
+ ulint n_tickets_to_enter_innodb;
+ /* this can be > 0 only when
+ declared_to_... is TRUE; when we come
+ to srv_conc_innodb_enter, if the value
+ here is > 0, we decrement this by 1 */
+ /*------------------------------*/
lock_t* auto_inc_lock; /* possible auto-inc lock reserved by
the transaction; note that it is also
in the lock list trx_locks */