Commit 184ee488 authored by marko's avatar marko

branches/zip: Non-functional change for reducing dependencies in InnoDB Hot Backup:

Replace srv_sys->dummy_ind1 and srv_sys->dummy_ind2 with
dict_ind_redundant and dict_ind_compact, initialized in dict_init().
parent 11310168
2009-03-20 The InnoDB Team
* dict/dict0boot.c, dict/dict0dict.c, fsp/fsp0fsp.c,
include/dict0dict.h, include/srv0srv.h, srv/srv0srv.c,
page/page0page.c:
Replace srv_sys->dummy_ind1 and srv_sys->dummy_ind2 with
dict_ind_redundant and dict_ind_compact, which are
initialized by dict_init().
2009-03-05 The InnoDB Team
* handler/ha_innodb.cc, mysql-test/innodb-autoinc.result,
......
......@@ -161,7 +161,7 @@ dict_hdr_create(
/*--------------------------*/
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
DICT_HDR_SPACE, 0, DICT_TABLES_ID,
srv_sys->dummy_ind1, mtr);
dict_ind_redundant, mtr);
if (root_page_no == FIL_NULL) {
return(FALSE);
......@@ -172,7 +172,7 @@ dict_hdr_create(
/*--------------------------*/
root_page_no = btr_create(DICT_UNIQUE, DICT_HDR_SPACE, 0,
DICT_TABLE_IDS_ID,
srv_sys->dummy_ind1, mtr);
dict_ind_redundant, mtr);
if (root_page_no == FIL_NULL) {
return(FALSE);
......@@ -183,7 +183,7 @@ dict_hdr_create(
/*--------------------------*/
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
DICT_HDR_SPACE, 0, DICT_COLUMNS_ID,
srv_sys->dummy_ind1, mtr);
dict_ind_redundant, mtr);
if (root_page_no == FIL_NULL) {
return(FALSE);
......@@ -194,7 +194,7 @@ dict_hdr_create(
/*--------------------------*/
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
DICT_HDR_SPACE, 0, DICT_INDEXES_ID,
srv_sys->dummy_ind1, mtr);
dict_ind_redundant, mtr);
if (root_page_no == FIL_NULL) {
return(FALSE);
......@@ -205,7 +205,7 @@ dict_hdr_create(
/*--------------------------*/
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
DICT_HDR_SPACE, 0, DICT_FIELDS_ID,
srv_sys->dummy_ind1, mtr);
dict_ind_redundant, mtr);
if (root_page_no == FIL_NULL) {
return(FALSE);
......
......@@ -28,6 +28,11 @@ Created 1/8/1996 Heikki Tuuri
#include "dict0dict.ic"
#endif
/* dummy index for ROW_FORMAT=REDUNDANT supremum and infimum records */
dict_index_t* dict_ind_redundant;
/* dummy index for ROW_FORMAT=COMPACT supremum and infimum records */
dict_index_t* dict_ind_compact;
#include "buf0buf.h"
#include "data0type.h"
#include "mach0data.h"
......@@ -4621,6 +4626,40 @@ dict_index_name_print(
ut_print_name(file, trx, TRUE, index->table_name);
}
/**************************************************************************
Inits dict_ind_redundant and dict_ind_compact. */
UNIV_INTERN
void
dict_ind_init(void)
/*===============*/
{
dict_table_t* table;
/* create dummy table and index for REDUNDANT infimum and supremum */
table = dict_mem_table_create("SYS_DUMMY1", DICT_HDR_SPACE, 1, 0);
dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR,
DATA_ENGLISH | DATA_NOT_NULL, 8);
dict_ind_redundant = dict_mem_index_create("SYS_DUMMY1", "SYS_DUMMY1",
DICT_HDR_SPACE, 0, 1);
dict_index_add_col(dict_ind_redundant, table,
dict_table_get_nth_col(table, 0), 0);
dict_ind_redundant->table = table;
/* create dummy table and index for COMPACT infimum and supremum */
table = dict_mem_table_create("SYS_DUMMY2",
DICT_HDR_SPACE, 1, DICT_TF_COMPACT);
dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR,
DATA_ENGLISH | DATA_NOT_NULL, 8);
dict_ind_compact = dict_mem_index_create("SYS_DUMMY2", "SYS_DUMMY2",
DICT_HDR_SPACE, 0, 1);
dict_index_add_col(dict_ind_compact, table,
dict_table_get_nth_col(table, 0), 0);
dict_ind_compact->table = table;
/* avoid ut_ad(index->cached) in dict_index_get_n_unique_in_tree */
dict_ind_redundant->cached = dict_ind_compact->cached = TRUE;
}
/**************************************************************************
Get index by name */
UNIV_INTERN
......
......@@ -994,7 +994,7 @@ fsp_header_init(
fsp_fill_free_list(FALSE, space, header, mtr);
btr_create(DICT_CLUSTERED | DICT_UNIVERSAL | DICT_IBUF,
0, 0, ut_dulint_add(DICT_IBUF_ID_MIN, space),
srv_sys->dummy_ind1, mtr);
dict_ind_redundant, mtr);
} else {
fsp_fill_free_list(TRUE, space, header, mtr);
}
......
......@@ -1140,6 +1140,18 @@ struct dict_sys_struct{
dict_table_t* sys_fields; /* SYS_FIELDS table */
};
/* dummy index for ROW_FORMAT=REDUNDANT supremum and infimum records */
extern dict_index_t* dict_ind_redundant;
/* dummy index for ROW_FORMAT=COMPACT supremum and infimum records */
extern dict_index_t* dict_ind_compact;
/**************************************************************************
Inits dict_ind_redundant and dict_ind_compact. */
UNIV_INTERN
void
dict_ind_init(void);
/*===============*/
#ifndef UNIV_NONINL
#include "dict0dict.ic"
#endif
......
......@@ -578,10 +578,6 @@ struct srv_sys_struct{
srv_table_t* threads; /* server thread table */
UT_LIST_BASE_NODE_T(que_thr_t)
tasks; /* task queue */
dict_index_t* dummy_ind1; /* dummy index for old-style
supremum and infimum records */
dict_index_t* dummy_ind2; /* dummy index for new-style
supremum and infimum records */
};
extern ulint srv_n_threads_active[];
......
......@@ -343,9 +343,9 @@ page_create_low(
/* The infimum and supremum records use a dummy index. */
if (UNIV_LIKELY(comp)) {
index = srv_sys->dummy_ind2;
index = dict_ind_compact;
} else {
index = srv_sys->dummy_ind1;
index = dict_ind_redundant;
}
/* 1. INCREMENT MODIFY CLOCK */
......
......@@ -859,7 +859,6 @@ srv_init(void)
{
srv_conc_slot_t* conc_slot;
srv_slot_t* slot;
dict_table_t* table;
ulint i;
srv_sys = mem_alloc(sizeof(srv_sys_t));
......@@ -905,30 +904,9 @@ srv_init(void)
UT_LIST_INIT(srv_sys->tasks);
/* create dummy table and index for old-style infimum and supremum */
table = dict_mem_table_create("SYS_DUMMY1",
DICT_HDR_SPACE, 1, 0);
dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR,
DATA_ENGLISH | DATA_NOT_NULL, 8);
srv_sys->dummy_ind1 = dict_mem_index_create(
"SYS_DUMMY1", "SYS_DUMMY1", DICT_HDR_SPACE, 0, 1);
dict_index_add_col(srv_sys->dummy_ind1, table,
dict_table_get_nth_col(table, 0), 0);
srv_sys->dummy_ind1->table = table;
/* create dummy table and index for new-style infimum and supremum */
table = dict_mem_table_create("SYS_DUMMY2",
DICT_HDR_SPACE, 1, DICT_TF_COMPACT);
dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR,
DATA_ENGLISH | DATA_NOT_NULL, 8);
srv_sys->dummy_ind2 = dict_mem_index_create(
"SYS_DUMMY2", "SYS_DUMMY2", DICT_HDR_SPACE, 0, 1);
dict_index_add_col(srv_sys->dummy_ind2, table,
dict_table_get_nth_col(table, 0), 0);
srv_sys->dummy_ind2->table = table;
/* avoid ut_ad(index->cached) in dict_index_get_n_unique_in_tree */
srv_sys->dummy_ind1->cached = srv_sys->dummy_ind2->cached = TRUE;
/* Create dummy indexes for infimum and supremum records */
dict_ind_init();
/* Init the server concurrency restriction data structures */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment