diff options
Diffstat (limited to 'innobase/include')
-rw-r--r-- | innobase/include/data0data.h | 6 | ||||
-rw-r--r-- | innobase/include/dict0mem.h | 17 | ||||
-rw-r--r-- | innobase/include/hash0hash.h | 20 | ||||
-rw-r--r-- | innobase/include/hash0hash.ic | 8 | ||||
-rw-r--r-- | innobase/include/mtr0mtr.h | 14 | ||||
-rw-r--r-- | innobase/include/row0ins.h | 5 | ||||
-rw-r--r-- | innobase/include/row0upd.h | 5 |
7 files changed, 39 insertions, 36 deletions
diff --git a/innobase/include/data0data.h b/innobase/include/data0data.h index 2501d2b809f..c4e93bec738 100644 --- a/innobase/include/data0data.h +++ b/innobase/include/data0data.h @@ -402,9 +402,11 @@ struct dtuple_struct { UT_LIST_NODE_T(dtuple_t) tuple_list; /* data tuples can be linked into a list using this field */ - ulint magic_n; -}; +#ifdef UNIV_DEBUG + ulint magic_n; #define DATA_TUPLE_MAGIC_N 65478679 +#endif /* UNIV_DEBUG */ +}; /* A slot for a field in a big rec vector */ diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h index 03dc913a7c9..1930825f601 100644 --- a/innobase/include/dict0mem.h +++ b/innobase/include/dict0mem.h @@ -198,10 +198,11 @@ struct dict_tree_struct{ the list; if the tree is of the mixed type, the first index in the list is the index of the cluster which owns the tree */ +#ifdef UNIV_DEBUG ulint magic_n;/* magic number */ -}; - #define DICT_TREE_MAGIC_N 7545676 +#endif /* UNIV_DEBUG */ +}; /* Data structure for an index */ struct dict_index_struct{ @@ -247,7 +248,10 @@ struct dict_index_struct{ ulint stat_n_leaf_pages; /* approximate number of leaf pages in the index tree */ +#ifdef UNIV_DEBUG ulint magic_n;/* magic number */ +#define DICT_INDEX_MAGIC_N 76789786 +#endif /* UNIV_DEBUG */ }; /* Data structure for a foreign key constraint; an example: @@ -298,9 +302,6 @@ a foreign key constraint is enforced, therefore RESTRICT just means no flag */ #define DICT_FOREIGN_ON_DELETE_NO_ACTION 16 #define DICT_FOREIGN_ON_UPDATE_NO_ACTION 32 - -#define DICT_INDEX_MAGIC_N 76789786 - /* Data structure for a database table */ struct dict_table_struct{ dulint id; /* id of the table or cluster */ @@ -412,10 +413,12 @@ struct dict_table_struct{ inited; MySQL gets the init value by executing SELECT MAX(auto inc column) */ ib_longlong autoinc;/* autoinc counter value to give to the - next inserted row */ + next inserted row */ +#ifdef UNIV_DEBUG ulint magic_n;/* magic number */ -}; #define DICT_TABLE_MAGIC_N 76333786 +#endif /* UNIV_DEBUG */ +}; /* Data structure for a stored procedure */ struct dict_proc_struct{ diff --git a/innobase/include/hash0hash.h b/innobase/include/hash0hash.h index 378925a5bea..2669520b753 100644 --- a/innobase/include/hash0hash.h +++ b/innobase/include/hash0hash.h @@ -300,21 +300,6 @@ hash_mutex_exit( /*============*/ hash_table_t* table, /* in: hash table */ ulint fold); /* in: fold */ -/**************************************************************** -Reserves all the mutexes of a hash table, in an ascending order. */ - -void -hash_mutex_enter_all( -/*=================*/ - hash_table_t* table); /* in: hash table */ -/**************************************************************** -Releases all the mutexes of a hash table. */ - -void -hash_mutex_exit_all( -/*================*/ - hash_table_t* table); /* in: hash table */ - struct hash_cell_struct{ void* node; /* hash chain node, NULL if none */ @@ -333,10 +318,11 @@ struct hash_table_struct { memory heaps; there are then n_mutexes many of these heaps */ mem_heap_t* heap; +#ifdef UNIV_DEBUG ulint magic_n; -}; - #define HASH_TABLE_MAGIC_N 76561114 +#endif /* UNIV_DEBUG */ +}; #ifndef UNIV_NONINL #include "hash0hash.ic" diff --git a/innobase/include/hash0hash.ic b/innobase/include/hash0hash.ic index 0d713140c13..1b9acfa2f34 100644 --- a/innobase/include/hash0hash.ic +++ b/innobase/include/hash0hash.ic @@ -18,6 +18,7 @@ hash_get_nth_cell( hash_table_t* table, /* in: hash table */ ulint n) /* in: cell index */ { + ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); ut_ad(n < table->n_cells); return(table->array + n); @@ -32,6 +33,7 @@ hash_get_n_cells( /* out: number of cells */ hash_table_t* table) /* in: table */ { + ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); return(table->n_cells); } @@ -45,6 +47,7 @@ hash_calc_hash( ulint fold, /* in: folded value */ hash_table_t* table) /* in: hash table */ { + ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); return(ut_hash_ulint(fold, table->n_cells)); } @@ -58,6 +61,7 @@ hash_get_mutex_no( hash_table_t* table, /* in: hash table */ ulint fold) /* in: fold */ { + ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); return(ut_2pow_remainder(fold, table->n_mutexes)); } @@ -71,6 +75,7 @@ hash_get_nth_heap( hash_table_t* table, /* in: hash table */ ulint i) /* in: index of the heap */ { + ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); ut_ad(i < table->n_mutexes); return(table->heaps[i]); @@ -88,6 +93,8 @@ hash_get_heap( { ulint i; + ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); + if (table->heap) { return(table->heap); } @@ -107,6 +114,7 @@ hash_get_nth_mutex( hash_table_t* table, /* in: hash table */ ulint i) /* in: index of the mutex */ { + ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); ut_ad(i < table->n_mutexes); return(table->mutexes + i); diff --git a/innobase/include/mtr0mtr.h b/innobase/include/mtr0mtr.h index 86b7c3345ff..dd582adcb6f 100644 --- a/innobase/include/mtr0mtr.h +++ b/innobase/include/mtr0mtr.h @@ -290,7 +290,12 @@ struct mtr_memo_slot_struct{ /* Mini-transaction handle and buffer */ struct mtr_struct{ +#ifdef UNIV_DEBUG ulint state; /* MTR_ACTIVE, MTR_COMMITTING, MTR_COMMITTED */ +#define MTR_ACTIVE 12231 +#define MTR_COMMITTING 56456 +#define MTR_COMMITTED 34676 +#endif /* UNIV_DEBUG */ dyn_array_t memo; /* memo stack for locks etc. */ dyn_array_t log; /* mini-transaction log */ ibool modifications; @@ -305,15 +310,12 @@ struct mtr_struct{ this mtr */ dulint end_lsn;/* end lsn of the possible log entry for this mtr */ +#ifdef UNIV_DEBUG ulint magic_n; -}; - #define MTR_MAGIC_N 54551 +#endif /* UNIV_DEBUG */ +}; -#define MTR_ACTIVE 12231 -#define MTR_COMMITTING 56456 -#define MTR_COMMITTED 34676 - #ifndef UNIV_NONINL #include "mtr0mtr.ic" #endif diff --git a/innobase/include/row0ins.h b/innobase/include/row0ins.h index a5b4b74e7fc..f3f0b7e8eca 100644 --- a/innobase/include/row0ins.h +++ b/innobase/include/row0ins.h @@ -145,10 +145,11 @@ struct ins_node_struct{ entry_list and sys fields are stored here; if this is NULL, entry list should be created and buffers for sys fields in row allocated */ +#ifdef UNIV_DEBUG ulint magic_n; -}; - #define INS_NODE_MAGIC_N 15849075 +#endif /* UNIV_DEBUG */ +}; /* Insert node types */ #define INS_SEARCHED 0 /* INSERT INTO ... SELECT ... */ diff --git a/innobase/include/row0upd.h b/innobase/include/row0upd.h index f5e0a88231f..687e90deee5 100644 --- a/innobase/include/row0upd.h +++ b/innobase/include/row0upd.h @@ -384,10 +384,11 @@ struct upd_node_struct{ sym_node_t* table_sym;/* table node in symbol table */ que_node_t* col_assign_list; /* column assignment list */ +#ifdef UNIV_DEBUG ulint magic_n; -}; - #define UPD_NODE_MAGIC_N 1579975 +#endif /* UNIV_DEBUG */ +}; /* Node execution states */ #define UPD_NODE_SET_IX_LOCK 1 /* execution came to the node from |