summaryrefslogtreecommitdiff
path: root/innobase/dict/dict0dict.c
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-01-14 13:54:23 +0200
committerunknown <marko@hundin.mysql.fi>2005-01-14 13:54:23 +0200
commit4db9aaeea7e8ffce21740913071d58793340af3d (patch)
treed120530f84497dffd33fe530b9a42f36fe657b37 /innobase/dict/dict0dict.c
parentc277421d06a7442aa7e25bf85b5b918fec1c45c0 (diff)
downloadmariadb-git-4db9aaeea7e8ffce21740913071d58793340af3d.tar.gz
InnoDB: Remove redundant page_no field from dict_index_t.
This completes the patch for fast TRUNCATE TABLE. innobase/dict/dict0boot.c: dict_boot(): Add page_no parameter to dict_index_add_to_cache() innobase/dict/dict0crea.c: Remove dict_index_t:page_no; add ind_node_t:page_no innobase/dict/dict0dict.c: dict_index_add_to_cache(): Add parameter page_no dict_tree_create(): Add parameter page_no innobase/dict/dict0load.c: dict_load_indexes(): Add page_no to dict_index_add_to_cache() call innobase/ibuf/ibuf0ibuf.c: ibuf_data_init_for_space(): Move page_no to dict_index_add_to_cache() innobase/include/dict0crea.h: ind_node_t: Add page_no field innobase/include/dict0dict.h: dict_index_add_to_cache(): Add page_no dict_tree_create(): Add page_no innobase/include/dict0mem.h: dict_index_t: Remove page_no, as dict_tree_t has "page" field innobase/row/row0mysql.c: row_truncate_table_for_mysql(): Improve the comments
Diffstat (limited to 'innobase/dict/dict0dict.c')
-rw-r--r--innobase/dict/dict0dict.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index d5e0a46fd39..12749f7704f 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -1374,8 +1374,9 @@ dict_index_add_to_cache(
/*====================*/
/* out: TRUE if success */
dict_table_t* table, /* in: table on which the index is */
- dict_index_t* index) /* in, own: index; NOTE! The index memory
+ dict_index_t* index, /* in, own: index; NOTE! The index memory
object is freed in this function! */
+ ulint page_no)/* in: root page number of the index */
{
dict_index_t* new_index;
dict_tree_t* tree;
@@ -1461,10 +1462,9 @@ dict_index_add_to_cache(
tree = dict_index_get_tree(
UT_LIST_GET_FIRST(cluster->indexes));
new_index->tree = tree;
- new_index->page_no = tree->page;
} else {
/* Create an index tree memory object for the index */
- tree = dict_tree_create(new_index);
+ tree = dict_tree_create(new_index, page_no);
ut_ad(tree);
new_index->tree = tree;
@@ -1749,7 +1749,6 @@ dict_index_build_internal_clust(
new_index->n_user_defined_cols = index->n_fields;
new_index->id = index->id;
- new_index->page_no = index->page_no;
if (table->type != DICT_TABLE_ORDINARY) {
/* The index is mixed: copy common key prefix fields */
@@ -1928,7 +1927,6 @@ dict_index_build_internal_non_clust(
new_index->n_user_defined_cols = index->n_fields;
new_index->id = index->id;
- new_index->page_no = index->page_no;
/* Copy fields from index to new_index */
dict_index_copy(new_index, index, 0, index->n_fields);
@@ -3565,9 +3563,10 @@ dict_tree_t*
dict_tree_create(
/*=============*/
/* out, own: created tree */
- dict_index_t* index) /* in: the index for which to create: in the
+ dict_index_t* index, /* in: the index for which to create: in the
case of a mixed tree, this should be the
index of the cluster object */
+ ulint page_no)/* in: root page number of the index */
{
dict_tree_t* tree;
@@ -3577,7 +3576,7 @@ dict_tree_create(
tree->type = index->type;
tree->space = index->space;
- tree->page = index->page_no;
+ tree->page = page_no;
tree->id = index->id;