summaryrefslogtreecommitdiff
path: root/innobase/include
diff options
context:
space:
mode:
authorunknown <heikki@donna.mysql.fi>2002-02-04 23:55:41 +0200
committerunknown <heikki@donna.mysql.fi>2002-02-04 23:55:41 +0200
commit9871a6d080f507f58afa91bfd7624c27b27963cd (patch)
tree8afb00e0a5c01501d06fda6b055c26e219075b91 /innobase/include
parent3518de828d1c7c384ea3503ae2ce1477bf4a9095 (diff)
downloadmariadb-git-9871a6d080f507f58afa91bfd7624c27b27963cd.tar.gz
Many files:
Small improvements row0mysql.c: Small improvements + fix the ALTER TABLE problem by introducing a lazy drop table it can use ha_innobase.cc: Some fine-tuning of optimization sql/ha_innobase.cc: Some fine-tuning of optimization innobase/include/log0recv.h: Small improvements innobase/include/mem0mem.h: Small improvements innobase/include/mem0pool.h: Small improvements innobase/include/row0mysql.h: Small improvements innobase/include/srv0srv.h: Small improvements innobase/include/trx0trx.h: Small improvements innobase/buf/buf0lru.c: Small improvements innobase/fil/fil0fil.c: Small improvements innobase/log/log0recv.c: Small improvements innobase/mem/mem0mem.c: Small improvements innobase/mem/mem0pool.c: Small improvements innobase/row/row0mysql.c: Small improvements + fix the ALTER TABLE problem by introducing a lazy drop table it can use innobase/srv/srv0srv.c: Small improvements innobase/srv/srv0start.c: Small improvements innobase/trx/trx0purge.c: Small improvements innobase/trx/trx0trx.c: Small improvements
Diffstat (limited to 'innobase/include')
-rw-r--r--innobase/include/log0recv.h1
-rw-r--r--innobase/include/mem0mem.h19
-rw-r--r--innobase/include/mem0pool.h12
-rw-r--r--innobase/include/row0mysql.h20
-rw-r--r--innobase/include/srv0srv.h6
-rw-r--r--innobase/include/trx0trx.h17
6 files changed, 71 insertions, 4 deletions
diff --git a/innobase/include/log0recv.h b/innobase/include/log0recv.h
index 51f14393d38..8f896756db9 100644
--- a/innobase/include/log0recv.h
+++ b/innobase/include/log0recv.h
@@ -258,6 +258,7 @@ struct recv_sys_struct{
extern recv_sys_t* recv_sys;
extern ibool recv_recovery_on;
extern ibool recv_no_ibuf_operations;
+extern ibool recv_needed_recovery;
/* States of recv_addr_struct */
#define RECV_NOT_PROCESSED 71
diff --git a/innobase/include/mem0mem.h b/innobase/include/mem0mem.h
index 57fac93d3ac..89c5428f054 100644
--- a/innobase/include/mem0mem.h
+++ b/innobase/include/mem0mem.h
@@ -269,13 +269,24 @@ mem_realloc(
ulint n, /* in: desired number of bytes */
char* file_name,/* in: file name where called */
ulint line); /* in: line where called */
+#ifdef MEM_PERIODIC_CHECK
+/**********************************************************************
+Goes through the list of all allocated mem blocks, checks their magic
+numbers, and reports possible corruption. */
+void
+mem_validate_all_blocks(void);
+/*=========================*/
+#endif
/*#######################################################################*/
/* The info header of a block in a memory heap */
struct mem_block_info_struct {
+ 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 */
UT_LIST_BASE_NODE_T(mem_block_t) base; /* In the first block in the
the list this is the base node of the list of blocks;
in subsequent blocks this is undefined */
@@ -299,9 +310,11 @@ struct mem_block_info_struct {
allocated buffer frame, which can be appended as a
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 */
+#ifdef MEM_PERIODIC_CHECK
+ UT_LIST_NODE_T(mem_block_t) mem_block_list;
+ /* List of all mem blocks allocated; protected
+ by the mem_comm_pool mutex */
+#endif
};
#define MEM_BLOCK_MAGIC_N 764741555
diff --git a/innobase/include/mem0pool.h b/innobase/include/mem0pool.h
index eb675b4a7f9..43707bd5f61 100644
--- a/innobase/include/mem0pool.h
+++ b/innobase/include/mem0pool.h
@@ -72,6 +72,18 @@ mem_pool_get_reserved(
/* out: reserved mmeory in bytes */
mem_pool_t* pool); /* in: memory pool */
/************************************************************************
+Reserves the mem pool mutex. */
+
+void
+mem_pool_mutex_enter(void);
+/*======================*/
+/************************************************************************
+Releases the mem pool mutex. */
+
+void
+mem_pool_mutex_exit(void);
+/*=====================*/
+/************************************************************************
Validates a memory pool. */
ibool
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index 0346299bb10..48b6ba8a715 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -251,6 +251,24 @@ row_table_add_foreign_constraints(
char* name); /* in: table full name in the normalized form
database_name/table_name */
/*************************************************************************
+The master thread in srv0srv.c calls this regularly to drop tables which
+we must drop in background after queries to them have ended. Such lazy
+dropping of tables is needed in ALTER TABLE on Unix. */
+
+ulint
+row_drop_tables_for_mysql_in_background(void);
+/*=========================================*/
+ /* out: how many tables dropped
+ + remaining tables in list */
+/*************************************************************************
+Get the background drop list length. NOTE: the caller must own the kernel
+mutex! */
+
+ulint
+row_get_background_drop_list_len_low(void);
+/*======================================*/
+ /* out: how many tables in list */
+/*************************************************************************
Drops a table for MySQL. If the name of the dropped table ends to
characters INNODB_MONITOR, then this also stops printing of monitor
output by the master thread. */
@@ -426,7 +444,7 @@ struct row_prebuilt_struct {
fetched row in fetch_cache */
ulint n_fetch_cached; /* number of not yet fetched rows
in fetch_cache */
- mem_heap_t* blob_heap; /* in SELECTS BLOB fields are copied
+ mem_heap_t* blob_heap; /* in SELECTS BLOB fie lds are copied
to this heap */
mem_heap_t* old_vers_heap; /* memory heap where a previous
version is built in consistent read */
diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h
index 05989c6410e..01986c759d7 100644
--- a/innobase/include/srv0srv.h
+++ b/innobase/include/srv0srv.h
@@ -249,6 +249,12 @@ mutex, for performace reasons). */
void
srv_active_wake_master_thread(void);
/*===============================*/
+/***********************************************************************
+Wakes up the master thread if it is suspended or being suspended. */
+
+void
+srv_wake_master_thread(void);
+/*========================*/
/*************************************************************************
Puts an OS thread to wait if there are too many concurrent threads
(>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue. */
diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h
index d67628b8bad..26c9ace08b6 100644
--- a/innobase/include/trx0trx.h
+++ b/innobase/include/trx0trx.h
@@ -50,6 +50,13 @@ trx_allocate_for_mysql(void);
/*========================*/
/* out, own: transaction object */
/************************************************************************
+Creates a transaction object for background operations by the master thread. */
+
+trx_t*
+trx_allocate_for_background(void);
+/*=============================*/
+ /* out, own: transaction object */
+/************************************************************************
Frees a transaction object. */
void
@@ -63,6 +70,13 @@ void
trx_free_for_mysql(
/*===============*/
trx_t* trx); /* in, own: trx object */
+/************************************************************************
+Frees a transaction object of a background operation of the master thread. */
+
+void
+trx_free_for_background(
+/*====================*/
+ trx_t* trx); /* in, own: trx object */
/********************************************************************
Creates trx objects for transactions and initializes the trx list of
trx_sys at database start. Rollback segment and undo log lists must
@@ -266,11 +280,14 @@ struct trx_sig_struct{
transaction is waiting a reply */
};
+#define TRX_MAGIC_N 91118598
+
/* The transaction handle; every session has a trx object which is freed only
when the session is freed; in addition there may be session-less transactions
rolling back after a database recovery */
struct trx_struct{
+ ulint magic_n;
/* All the next fields are protected by the kernel mutex, except the
undo logs which are protected by undo_mutex */
char* op_info; /* English text describing the