InnoDB cleanup:

Disable log archiving code unless #ifdef UNIV_LOG_ARCHIVE
Remove (char*) casts of string constants; add const qualifiers
Remove some Hot Backup code unless #ifdef UNIV_HOTBACKUP
This commit is contained in:
marko@hundin.mysql.fi 2004-05-27 15:27:43 +03:00
parent e27322d826
commit fc85c80b88
33 changed files with 514 additions and 430 deletions

View File

@ -2937,7 +2937,7 @@ btr_cur_mark_dtuple_inherited_extern(
if (!is_updated) { if (!is_updated) {
dfield = dtuple_get_nth_field(entry, ext_vec[i]); dfield = dtuple_get_nth_field(entry, ext_vec[i]);
data = dfield_get_data(dfield); data = (byte*) dfield_get_data(dfield);
len = dfield_get_len(dfield); len = dfield_get_len(dfield);
len -= BTR_EXTERN_FIELD_REF_SIZE; len -= BTR_EXTERN_FIELD_REF_SIZE;
@ -2997,7 +2997,7 @@ btr_cur_unmark_dtuple_extern_fields(
for (i = 0; i < n_ext_vec; i++) { for (i = 0; i < n_ext_vec; i++) {
dfield = dtuple_get_nth_field(entry, ext_vec[i]); dfield = dtuple_get_nth_field(entry, ext_vec[i]);
data = dfield_get_data(dfield); data = (byte*) dfield_get_data(dfield);
len = dfield_get_len(dfield); len = dfield_get_len(dfield);
len -= BTR_EXTERN_FIELD_REF_SIZE; len -= BTR_EXTERN_FIELD_REF_SIZE;

View File

@ -719,7 +719,9 @@ buf_awe_map_page_to_frame(
{ {
buf_block_t* bck; buf_block_t* bck;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex))); ut_ad(mutex_own(&(buf_pool->mutex)));
#endif /* UNIV_SYNC_DEBUG */
ut_ad(block); ut_ad(block);
if (block->frame) { if (block->frame) {

View File

@ -640,7 +640,7 @@ buf_read_ibuf_merge_pages(
if (buf_debug_prints) { if (buf_debug_prints) {
fprintf(stderr, fprintf(stderr,
"Ibuf merge read-ahead space %lu pages %lu\n", "Ibuf merge read-ahead space %lu pages %lu\n",
(ulong) space, (ulong) n_stored); (ulong) space_ids[0], (ulong) n_stored);
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
} }

View File

@ -254,29 +254,26 @@ dict_boot(void)
/* Insert into the dictionary cache the descriptions of the basic /* Insert into the dictionary cache the descriptions of the basic
system tables */ system tables */
/*-------------------------*/ /*-------------------------*/
table = dict_mem_table_create((char *) "SYS_TABLES", DICT_HDR_SPACE,8); table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE,8);
dict_mem_table_add_col(table, (char *) "NAME", DATA_BINARY, 0, 0, 0); dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
dict_mem_table_add_col(table, (char *) "ID", DATA_BINARY, 0, 0, 0); dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0, 0);
dict_mem_table_add_col(table, (char *) "N_COLS", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "N_COLS", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "TYPE", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "MIX_ID", DATA_BINARY, 0, 0, 0); dict_mem_table_add_col(table, "MIX_ID", DATA_BINARY, 0, 0, 0);
dict_mem_table_add_col(table, (char *) "MIX_LEN", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "MIX_LEN", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "CLUSTER_NAME", DATA_BINARY, dict_mem_table_add_col(table, "CLUSTER_NAME", DATA_BINARY, 0, 0, 0);
0, 0, 0); dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "SPACE", DATA_INT, 0, 4, 0);
table->id = DICT_TABLES_ID; table->id = DICT_TABLES_ID;
dict_table_add_to_cache(table); dict_table_add_to_cache(table);
dict_sys->sys_tables = table; dict_sys->sys_tables = table;
index = dict_mem_index_create((char *) "SYS_TABLES", (char *) index = dict_mem_index_create("SYS_TABLES", "CLUST_IND",
"CLUST_IND", DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 1);
DICT_HDR_SPACE,
DICT_UNIQUE | DICT_CLUSTERED, 1);
dict_mem_index_add_field(index, (char *) "NAME", 0, 0); dict_mem_index_add_field(index, "NAME", 0, 0);
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLES, index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLES,
MLOG_4BYTES, &mtr); MLOG_4BYTES, &mtr);
@ -284,52 +281,50 @@ dict_boot(void)
ut_a(dict_index_add_to_cache(table, index)); ut_a(dict_index_add_to_cache(table, index));
/*-------------------------*/ /*-------------------------*/
index = dict_mem_index_create((char *) "SYS_TABLES", index = dict_mem_index_create("SYS_TABLES", "ID_IND",
(char *) "ID_IND", DICT_HDR_SPACE, DICT_HDR_SPACE, DICT_UNIQUE, 1);
DICT_UNIQUE, 1); dict_mem_index_add_field(index, "ID", 0, 0);
dict_mem_index_add_field(index, (char *) "ID", 0, 0);
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLE_IDS, index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLE_IDS,
MLOG_4BYTES, &mtr); MLOG_4BYTES, &mtr);
index->id = DICT_TABLE_IDS_ID; index->id = DICT_TABLE_IDS_ID;
ut_a(dict_index_add_to_cache(table, index)); ut_a(dict_index_add_to_cache(table, index));
/*-------------------------*/ /*-------------------------*/
table = dict_mem_table_create((char *) "SYS_COLUMNS",DICT_HDR_SPACE,7); table = dict_mem_table_create("SYS_COLUMNS",DICT_HDR_SPACE,7);
dict_mem_table_add_col(table, (char *) "TABLE_ID", DATA_BINARY,0,0,0); dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY,0,0,0);
dict_mem_table_add_col(table, (char *) "POS", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "NAME", DATA_BINARY, 0, 0, 0); dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
dict_mem_table_add_col(table, (char *) "MTYPE", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "MTYPE", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "PRTYPE", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "PRTYPE", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "LEN", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "LEN", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "PREC", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "PREC", DATA_INT, 0, 4, 0);
table->id = DICT_COLUMNS_ID; table->id = DICT_COLUMNS_ID;
dict_table_add_to_cache(table); dict_table_add_to_cache(table);
dict_sys->sys_columns = table; dict_sys->sys_columns = table;
index = dict_mem_index_create((char *) "SYS_COLUMNS", index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND",
(char *) "CLUST_IND", DICT_HDR_SPACE, DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, (char *) "TABLE_ID", 0, 0); dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
dict_mem_index_add_field(index, (char *) "POS", 0, 0); dict_mem_index_add_field(index, "POS", 0, 0);
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_COLUMNS, index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_COLUMNS,
MLOG_4BYTES, &mtr); MLOG_4BYTES, &mtr);
index->id = DICT_COLUMNS_ID; index->id = DICT_COLUMNS_ID;
ut_a(dict_index_add_to_cache(table, index)); ut_a(dict_index_add_to_cache(table, index));
/*-------------------------*/ /*-------------------------*/
table = dict_mem_table_create((char *) "SYS_INDEXES",DICT_HDR_SPACE,7); table = dict_mem_table_create("SYS_INDEXES",DICT_HDR_SPACE,7);
dict_mem_table_add_col(table, (char *) "TABLE_ID", DATA_BINARY, 0,0,0); dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY, 0,0,0);
dict_mem_table_add_col(table, (char *) "ID", DATA_BINARY, 0, 0, 0); dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0, 0);
dict_mem_table_add_col(table, (char *) "NAME", DATA_BINARY, 0, 0, 0); dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
dict_mem_table_add_col(table, (char *) "N_FIELDS", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "N_FIELDS", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "TYPE", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "SPACE", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "PAGE_NO", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "PAGE_NO", DATA_INT, 0, 4, 0);
/* The '+ 2' below comes from the 2 system fields */ /* The '+ 2' below comes from the 2 system fields */
#if DICT_SYS_INDEXES_PAGE_NO_FIELD != 6 + 2 #if DICT_SYS_INDEXES_PAGE_NO_FIELD != 6 + 2
@ -343,34 +338,32 @@ dict_boot(void)
dict_table_add_to_cache(table); dict_table_add_to_cache(table);
dict_sys->sys_indexes = table; dict_sys->sys_indexes = table;
index = dict_mem_index_create((char *) "SYS_INDEXES", index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND",
(char *) "CLUST_IND", DICT_HDR_SPACE, DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, (char *) "TABLE_ID", 0, 0); dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
dict_mem_index_add_field(index, (char *) "ID", 0, 0); dict_mem_index_add_field(index, "ID", 0, 0);
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_INDEXES, index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_INDEXES,
MLOG_4BYTES, &mtr); MLOG_4BYTES, &mtr);
index->id = DICT_INDEXES_ID; index->id = DICT_INDEXES_ID;
ut_a(dict_index_add_to_cache(table, index)); ut_a(dict_index_add_to_cache(table, index));
/*-------------------------*/ /*-------------------------*/
table = dict_mem_table_create((char *) "SYS_FIELDS", DICT_HDR_SPACE,3); table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE,3);
dict_mem_table_add_col(table, (char *) "INDEX_ID", DATA_BINARY, 0,0,0); dict_mem_table_add_col(table, "INDEX_ID", DATA_BINARY, 0,0,0);
dict_mem_table_add_col(table, (char *) "POS", DATA_INT, 0, 4, 0); dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0);
dict_mem_table_add_col(table, (char *) "COL_NAME", DATA_BINARY, 0,0,0); dict_mem_table_add_col(table, "COL_NAME", DATA_BINARY, 0,0,0);
table->id = DICT_FIELDS_ID; table->id = DICT_FIELDS_ID;
dict_table_add_to_cache(table); dict_table_add_to_cache(table);
dict_sys->sys_fields = table; dict_sys->sys_fields = table;
index = dict_mem_index_create((char *) "SYS_FIELDS", index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND",
(char *) "CLUST_IND", DICT_HDR_SPACE, DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, (char *) "INDEX_ID", 0, 0); dict_mem_index_add_field(index, "INDEX_ID", 0, 0);
dict_mem_index_add_field(index, (char *) "POS", 0, 0); dict_mem_index_add_field(index, "POS", 0, 0);
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_FIELDS, index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_FIELDS,
MLOG_4BYTES, &mtr); MLOG_4BYTES, &mtr);

View File

@ -1004,12 +1004,12 @@ dict_create_or_check_foreign_constraint_tables(void)
que_t* graph; que_t* graph;
ulint error; ulint error;
trx_t* trx; trx_t* trx;
char* str; const char* str;
mutex_enter(&(dict_sys->mutex)); mutex_enter(&(dict_sys->mutex));
table1 = dict_table_get_low((char *) "SYS_FOREIGN"); table1 = dict_table_get_low("SYS_FOREIGN");
table2 = dict_table_get_low((char *) "SYS_FOREIGN_COLS"); table2 = dict_table_get_low("SYS_FOREIGN_COLS");
if (table1 && table2 if (table1 && table2
&& UT_LIST_GET_LEN(table1->indexes) == 3 && UT_LIST_GET_LEN(table1->indexes) == 3
@ -1027,20 +1027,20 @@ dict_create_or_check_foreign_constraint_tables(void)
trx = trx_allocate_for_mysql(); trx = trx_allocate_for_mysql();
trx->op_info = (char *) "creating foreign key sys tables"; trx->op_info = "creating foreign key sys tables";
row_mysql_lock_data_dictionary(trx); row_mysql_lock_data_dictionary(trx);
if (table1) { if (table1) {
fprintf(stderr, fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN table\n"); "InnoDB: dropping incompletely created SYS_FOREIGN table\n");
row_drop_table_for_mysql((char*)"SYS_FOREIGN", trx, TRUE); row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
} }
if (table2) { if (table2) {
fprintf(stderr, fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN_COLS table\n"); "InnoDB: dropping incompletely created SYS_FOREIGN_COLS table\n");
row_drop_table_for_mysql((char*)"SYS_FOREIGN_COLS", trx, TRUE); row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
} }
fprintf(stderr, fprintf(stderr,
@ -1050,7 +1050,7 @@ dict_create_or_check_foreign_constraint_tables(void)
there are 2 secondary indexes on SYS_FOREIGN, and they there are 2 secondary indexes on SYS_FOREIGN, and they
are defined just like below */ are defined just like below */
str = (char *) str =
"PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n" "PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n"
"BEGIN\n" "BEGIN\n"
"CREATE TABLE\n" "CREATE TABLE\n"
@ -1090,15 +1090,15 @@ dict_create_or_check_foreign_constraint_tables(void)
fprintf(stderr, fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN tables\n"); "InnoDB: dropping incompletely created SYS_FOREIGN tables\n");
row_drop_table_for_mysql((char*)"SYS_FOREIGN", trx, TRUE); row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
row_drop_table_for_mysql((char*)"SYS_FOREIGN_COLS", trx, TRUE); row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
error = DB_MUST_GET_MORE_FILE_SPACE; error = DB_MUST_GET_MORE_FILE_SPACE;
} }
que_graph_free(graph); que_graph_free(graph);
trx->op_info = (char *) ""; trx->op_info = "";
row_mysql_unlock_data_dictionary(trx); row_mysql_unlock_data_dictionary(trx);
@ -1161,7 +1161,7 @@ dict_create_add_foreigns_to_dictionary(
ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(mutex_own(&(dict_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
if (NULL == dict_table_get_low((char *) "SYS_FOREIGN")) { if (NULL == dict_table_get_low("SYS_FOREIGN")) {
fprintf(stderr, fprintf(stderr,
"InnoDB: table SYS_FOREIGN not found from internal data dictionary\n"); "InnoDB: table SYS_FOREIGN not found from internal data dictionary\n");

View File

@ -198,13 +198,14 @@ dict_tables_have_same_db(
/************************************************************************ /************************************************************************
Return the end of table name where we have removed dbname and '/'. */ Return the end of table name where we have removed dbname and '/'. */
static static
char* const char*
dict_remove_db_name( dict_remove_db_name(
/*================*/ /*================*/
/* out: table name */ /* out: table name */
char* name) /* in: table name in the form dbname '/' tablename */ const char* name) /* in: table name in the form
dbname '/' tablename */
{ {
char* s; const char* s;
s = strchr(name, '/'); s = strchr(name, '/');
ut_a(s); ut_a(s);
if (s) s++; if (s) s++;
@ -783,23 +784,33 @@ dict_table_add_to_cache(
The clustered index will not always physically contain all The clustered index will not always physically contain all
system columns. */ system columns. */
dict_mem_table_add_col(table, (char *) "DB_ROW_ID", DATA_SYS, dict_mem_table_add_col(table, "DB_ROW_ID", DATA_SYS,
DATA_ROW_ID, 0, 0); DATA_ROW_ID, 0, 0);
ut_ad(DATA_ROW_ID == 0); #if DATA_ROW_ID != 0
dict_mem_table_add_col(table, (char *) "DB_TRX_ID", DATA_SYS, #error "DATA_ROW_ID != 0"
#endif
dict_mem_table_add_col(table, "DB_TRX_ID", DATA_SYS,
DATA_TRX_ID, 0, 0); DATA_TRX_ID, 0, 0);
ut_ad(DATA_TRX_ID == 1); #if DATA_TRX_ID != 1
dict_mem_table_add_col(table, (char *) "DB_ROLL_PTR", DATA_SYS, #error "DATA_TRX_ID != 1"
DATA_ROLL_PTR, #endif
0, 0); dict_mem_table_add_col(table, "DB_ROLL_PTR", DATA_SYS,
ut_ad(DATA_ROLL_PTR == 2); DATA_ROLL_PTR, 0, 0);
#if DATA_ROLL_PTR != 2
#error "DATA_ROLL_PTR != 2"
#endif
dict_mem_table_add_col(table, (char *) "DB_MIX_ID", DATA_SYS, dict_mem_table_add_col(table, "DB_MIX_ID", DATA_SYS,
DATA_MIX_ID, 0, 0); DATA_MIX_ID, 0, 0);
ut_ad(DATA_MIX_ID == 3); #if DATA_MIX_ID != 3
ut_ad(DATA_N_SYS_COLS == 4); /* This assert reminds that if a new #error "DATA_MIX_ID != 3"
system column is added to the program, #endif
it should be dealt with here */
/* This check reminds that if a new system column is added to
the program, it should be dealt with here */
#if DATA_N_SYS_COLS != 4
#error "DATA_N_SYS_COLS != 4"
#endif
/* Look for a table with the same name: error if such exists */ /* Look for a table with the same name: error if such exists */
{ {
@ -1107,7 +1118,9 @@ dict_table_change_id_in_cache(
dulint new_id) /* in: new id to set */ dulint new_id) /* in: new id to set */
{ {
ut_ad(table); ut_ad(table);
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(mutex_own(&(dict_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
/* Remove the table from the hash table of id's */ /* Remove the table from the hash table of id's */
@ -1973,7 +1986,7 @@ dict_foreign_find(
/*==============*/ /*==============*/
/* out: foreign constraint */ /* out: foreign constraint */
dict_table_t* table, /* in: table object */ dict_table_t* table, /* in: table object */
char* id) /* in: foreign constraint id */ const char* id) /* in: foreign constraint id */
{ {
dict_foreign_t* foreign; dict_foreign_t* foreign;
@ -2367,7 +2380,7 @@ dict_scan_id(
*id = mem_heap_strdupl(heap, s, len); *id = mem_heap_strdupl(heap, s, len);
} else { } else {
/* no heap given: id will point to source string */ /* no heap given: id will point to source string */
*id = (char*) s; *id = s;
} }
return(ptr); return(ptr);
@ -2750,7 +2763,7 @@ dict_create_foreign_constraints_low(
ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(mutex_own(&(dict_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
table = dict_table_get_low((char*) name); table = dict_table_get_low(name);
if (table == NULL) { if (table == NULL) {
mutex_enter(&dict_foreign_err_mutex); mutex_enter(&dict_foreign_err_mutex);
@ -3936,7 +3949,7 @@ Prints a table data when we know the table name. */
void void
dict_table_print_by_name( dict_table_print_by_name(
/*=====================*/ /*=====================*/
char* name) const char* name)
{ {
dict_table_t* table; dict_table_t* table;

View File

@ -51,7 +51,7 @@ dict_get_first_table_name_in_db(
mtr_start(&mtr); mtr_start(&mtr);
sys_tables = dict_table_get_low((char *) "SYS_TABLES"); sys_tables = dict_table_get_low("SYS_TABLES");
sys_index = UT_LIST_GET_FIRST(sys_tables->indexes); sys_index = UT_LIST_GET_FIRST(sys_tables->indexes);
tuple = dtuple_create(heap, 1); tuple = dtuple_create(heap, 1);
@ -127,7 +127,7 @@ dict_print(void)
mtr_start(&mtr); mtr_start(&mtr);
sys_tables = dict_table_get_low((char *) "SYS_TABLES"); sys_tables = dict_table_get_low("SYS_TABLES");
sys_index = UT_LIST_GET_FIRST(sys_tables->indexes); sys_index = UT_LIST_GET_FIRST(sys_tables->indexes);
btr_pcur_open_at_index_side(TRUE, sys_index, BTR_SEARCH_LEAF, &pcur, btr_pcur_open_at_index_side(TRUE, sys_index, BTR_SEARCH_LEAF, &pcur,
@ -213,7 +213,7 @@ dict_check_tablespaces_or_store_max_id(
mtr_start(&mtr); mtr_start(&mtr);
sys_tables = dict_table_get_low((char *) "SYS_TABLES"); sys_tables = dict_table_get_low("SYS_TABLES");
sys_index = UT_LIST_GET_FIRST(sys_tables->indexes); sys_index = UT_LIST_GET_FIRST(sys_tables->indexes);
btr_pcur_open_at_index_side(TRUE, sys_index, BTR_SEARCH_LEAF, &pcur, btr_pcur_open_at_index_side(TRUE, sys_index, BTR_SEARCH_LEAF, &pcur,
@ -312,7 +312,7 @@ dict_load_columns(
mtr_start(&mtr); mtr_start(&mtr);
sys_columns = dict_table_get_low((char*) "SYS_COLUMNS"); sys_columns = dict_table_get_low("SYS_COLUMNS");
sys_index = UT_LIST_GET_FIRST(sys_columns->indexes); sys_index = UT_LIST_GET_FIRST(sys_columns->indexes);
tuple = dtuple_create(heap, 1); tuple = dtuple_create(heap, 1);
@ -342,7 +342,7 @@ dict_load_columns(
ut_ad(len == 4); ut_ad(len == 4);
ut_a(i == mach_read_from_4(field)); ut_a(i == mach_read_from_4(field));
ut_a(0 == ut_strcmp((char*) "NAME", ut_a(0 == ut_strcmp("NAME",
dict_field_get_col( dict_field_get_col(
dict_index_get_nth_field( dict_index_get_nth_field(
dict_table_get_first_index(sys_columns), 4))->name)); dict_table_get_first_index(sys_columns), 4))->name));
@ -368,7 +368,7 @@ dict_load_columns(
field = rec_get_nth_field(rec, 7, &len); field = rec_get_nth_field(rec, 7, &len);
col_len = mach_read_from_4(field); col_len = mach_read_from_4(field);
ut_a(0 == ut_strcmp((char*) "PREC", ut_a(0 == ut_strcmp("PREC",
dict_field_get_col( dict_field_get_col(
dict_index_get_nth_field( dict_index_get_nth_field(
dict_table_get_first_index(sys_columns), 8))->name)); dict_table_get_first_index(sys_columns), 8))->name));
@ -438,7 +438,7 @@ dict_load_fields(
mtr_start(&mtr); mtr_start(&mtr);
sys_fields = dict_table_get_low((char*) "SYS_FIELDS"); sys_fields = dict_table_get_low("SYS_FIELDS");
sys_index = UT_LIST_GET_FIRST(sys_fields->indexes); sys_index = UT_LIST_GET_FIRST(sys_fields->indexes);
tuple = dtuple_create(heap, 1); tuple = dtuple_create(heap, 1);
@ -489,7 +489,7 @@ dict_load_fields(
prefix_len = 0; prefix_len = 0;
} }
ut_a(0 == ut_strcmp((char*) "COL_NAME", ut_a(0 == ut_strcmp("COL_NAME",
dict_field_get_col( dict_field_get_col(
dict_index_get_nth_field( dict_index_get_nth_field(
dict_table_get_first_index(sys_fields), 4))->name)); dict_table_get_first_index(sys_fields), 4))->name));
@ -551,7 +551,7 @@ dict_load_indexes(
mtr_start(&mtr); mtr_start(&mtr);
sys_indexes = dict_table_get_low((char*) "SYS_INDEXES"); sys_indexes = dict_table_get_low("SYS_INDEXES");
sys_index = UT_LIST_GET_FIRST(sys_indexes->indexes); sys_index = UT_LIST_GET_FIRST(sys_indexes->indexes);
tuple = dtuple_create(heap, 1); tuple = dtuple_create(heap, 1);
@ -594,7 +594,7 @@ dict_load_indexes(
ut_ad(len == 8); ut_ad(len == 8);
id = mach_read_from_8(field); id = mach_read_from_8(field);
ut_a(0 == ut_strcmp((char*) "NAME", ut_a(0 == ut_strcmp("NAME",
dict_field_get_col( dict_field_get_col(
dict_index_get_nth_field( dict_index_get_nth_field(
dict_table_get_first_index(sys_indexes), 4))->name)); dict_table_get_first_index(sys_indexes), 4))->name));
@ -611,7 +611,7 @@ dict_load_indexes(
field = rec_get_nth_field(rec, 7, &len); field = rec_get_nth_field(rec, 7, &len);
space = mach_read_from_4(field); space = mach_read_from_4(field);
ut_a(0 == ut_strcmp((char*) "PAGE_NO", ut_a(0 == ut_strcmp("PAGE_NO",
dict_field_get_col( dict_field_get_col(
dict_index_get_nth_field( dict_index_get_nth_field(
dict_table_get_first_index(sys_indexes), 8))->name)); dict_table_get_first_index(sys_indexes), 8))->name));
@ -654,7 +654,7 @@ dict_load_indexes(
&& ((type & DICT_CLUSTERED) && ((type & DICT_CLUSTERED)
|| ((table == dict_sys->sys_tables) || ((table == dict_sys->sys_tables)
&& (name_len == (sizeof "ID_IND") - 1) && (name_len == (sizeof "ID_IND") - 1)
&& (0 == ut_memcmp(name_buf, (char*) "ID_IND", && (0 == ut_memcmp(name_buf, "ID_IND",
name_len))))) { name_len))))) {
/* The index was created in memory already at booting /* The index was created in memory already at booting
@ -721,7 +721,7 @@ dict_load_table(
mtr_start(&mtr); mtr_start(&mtr);
sys_tables = dict_table_get_low((char *) "SYS_TABLES"); sys_tables = dict_table_get_low("SYS_TABLES");
sys_index = UT_LIST_GET_FIRST(sys_tables->indexes); sys_index = UT_LIST_GET_FIRST(sys_tables->indexes);
tuple = dtuple_create(heap, 1); tuple = dtuple_create(heap, 1);
@ -757,7 +757,7 @@ dict_load_table(
return(NULL); return(NULL);
} }
ut_a(0 == ut_strcmp((char *) "SPACE", ut_a(0 == ut_strcmp("SPACE",
dict_field_get_col( dict_field_get_col(
dict_index_get_nth_field( dict_index_get_nth_field(
dict_table_get_first_index(sys_tables), 9))->name)); dict_table_get_first_index(sys_tables), 9))->name));
@ -782,7 +782,7 @@ dict_load_table(
} }
} }
ut_a(0 == ut_strcmp((char *) "N_COLS", ut_a(0 == ut_strcmp("N_COLS",
dict_field_get_col( dict_field_get_col(
dict_index_get_nth_field( dict_index_get_nth_field(
dict_table_get_first_index(sys_tables), 4))->name)); dict_table_get_first_index(sys_tables), 4))->name));
@ -794,7 +794,7 @@ dict_load_table(
table->ibd_file_missing = ibd_file_missing; table->ibd_file_missing = ibd_file_missing;
ut_a(0 == ut_strcmp((char *) "ID", ut_a(0 == ut_strcmp("ID",
dict_field_get_col( dict_field_get_col(
dict_index_get_nth_field( dict_index_get_nth_field(
dict_table_get_first_index(sys_tables), 3))->name)); dict_table_get_first_index(sys_tables), 3))->name));
@ -983,7 +983,7 @@ static
void void
dict_load_foreign_cols( dict_load_foreign_cols(
/*===================*/ /*===================*/
char* id, /* in: foreign constraint id as a null- const char* id, /* in: foreign constraint id as a null-
terminated string */ terminated string */
dict_foreign_t* foreign)/* in: foreign constraint object */ dict_foreign_t* foreign)/* in: foreign constraint object */
{ {
@ -1009,7 +1009,7 @@ dict_load_foreign_cols(
foreign->n_fields * sizeof(void*)); foreign->n_fields * sizeof(void*));
mtr_start(&mtr); mtr_start(&mtr);
sys_foreign_cols = dict_table_get_low((char *) "SYS_FOREIGN_COLS"); sys_foreign_cols = dict_table_get_low("SYS_FOREIGN_COLS");
sys_index = UT_LIST_GET_FIRST(sys_foreign_cols->indexes); sys_index = UT_LIST_GET_FIRST(sys_foreign_cols->indexes);
tuple = dtuple_create(foreign->heap, 1); tuple = dtuple_create(foreign->heap, 1);
@ -1056,9 +1056,9 @@ static
ulint ulint
dict_load_foreign( dict_load_foreign(
/*==============*/ /*==============*/
/* out: DB_SUCCESS or error code */ /* out: DB_SUCCESS or error code */
char* id) /* in: foreign constraint id as a null-terminated const char* id) /* in: foreign constraint id as a
string */ null-terminated string */
{ {
dict_foreign_t* foreign; dict_foreign_t* foreign;
dict_table_t* sys_foreign; dict_table_t* sys_foreign;
@ -1081,7 +1081,7 @@ dict_load_foreign(
mtr_start(&mtr); mtr_start(&mtr);
sys_foreign = dict_table_get_low((char *) "SYS_FOREIGN"); sys_foreign = dict_table_get_low("SYS_FOREIGN");
sys_index = UT_LIST_GET_FIRST(sys_foreign->indexes); sys_index = UT_LIST_GET_FIRST(sys_foreign->indexes);
tuple = dtuple_create(heap2, 1); tuple = dtuple_create(heap2, 1);
@ -1207,7 +1207,7 @@ dict_load_foreigns(
ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(mutex_own(&(dict_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
sys_foreign = dict_table_get_low((char *) "SYS_FOREIGN"); sys_foreign = dict_table_get_low("SYS_FOREIGN");
if (sys_foreign == NULL) { if (sys_foreign == NULL) {
/* No foreign keys defined yet in this database */ /* No foreign keys defined yet in this database */

View File

@ -274,7 +274,7 @@ fil_get_space_id_for_table(
/*=======================*/ /*=======================*/
/* out: space id, ULINT_UNDEFINED if not /* out: space id, ULINT_UNDEFINED if not
found */ found */
char* name); /* in: table name in the standard const char* name); /* in: table name in the standard
'databasename/tablename' format */ 'databasename/tablename' format */
@ -463,8 +463,9 @@ fil_node_open_file(
ulint size_high; ulint size_high;
ibool ret; ibool ret;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(system->mutex))); ut_ad(mutex_own(&(system->mutex)));
#endif /* UNIV_SYNC_DEBUG */
ut_a(node->n_pending == 0); ut_a(node->n_pending == 0);
ut_a(node->open == FALSE); ut_a(node->open == FALSE);
@ -575,8 +576,9 @@ fil_try_to_close_file_in_LRU(
fil_system_t* system = fil_system; fil_system_t* system = fil_system;
fil_node_t* node; fil_node_t* node;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(system->mutex))); ut_ad(mutex_own(&(system->mutex)));
#endif /* UNIV_SYNC_DEBUG */
node = UT_LIST_GET_LAST(system->LRU); node = UT_LIST_GET_LAST(system->LRU);
if (print_info) { if (print_info) {
@ -630,7 +632,9 @@ fil_mutex_enter_and_prepare_for_io(
ulint count = 0; ulint count = 0;
ulint count2 = 0; ulint count2 = 0;
#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&(system->mutex))); ut_ad(!mutex_own(&(system->mutex)));
#endif /* UNIV_SYNC_DEBUG */
retry: retry:
mutex_enter(&(system->mutex)); mutex_enter(&(system->mutex));
@ -1311,13 +1315,12 @@ fil_write_lsn_and_arch_no_to_file(
ulint sum_of_sizes, /* in: combined size of previous files in ulint sum_of_sizes, /* in: combined size of previous files in
space, in database pages */ space, in database pages */
dulint lsn, /* in: lsn to write */ dulint lsn, /* in: lsn to write */
ulint arch_log_no) /* in: archived log number to write */ ulint arch_log_no /* in: archived log number to write */
__attribute__((unused)))
{ {
byte* buf1; byte* buf1;
byte* buf; byte* buf;
UT_NOT_USED(arch_log_no);
buf1 = mem_alloc(2 * UNIV_PAGE_SIZE); buf1 = mem_alloc(2 * UNIV_PAGE_SIZE);
buf = ut_align(buf1, UNIV_PAGE_SIZE); buf = ut_align(buf1, UNIV_PAGE_SIZE);
@ -1396,17 +1399,16 @@ fil_read_flushed_lsn_and_arch_log_no(
os_file_t data_file, /* in: open data file */ os_file_t data_file, /* in: open data file */
ibool one_read_already, /* in: TRUE if min and max parameters ibool one_read_already, /* in: TRUE if min and max parameters
below already contain sensible data */ below already contain sensible data */
dulint* min_flushed_lsn, /* in/out: */ #ifdef UNIV_LOG_ARCHIVE
ulint* min_arch_log_no, /* in/out: */ ulint* min_arch_log_no, /* in/out: */
dulint* max_flushed_lsn, /* in/out: */ ulint* max_arch_log_no, /* in/out: */
ulint* max_arch_log_no) /* in/out: */ #endif /* UNIV_LOG_ARCHIVE */
dulint* min_flushed_lsn, /* in/out: */
dulint* max_flushed_lsn) /* in/out: */
{ {
byte* buf; byte* buf;
byte* buf2; byte* buf2;
dulint flushed_lsn; dulint flushed_lsn;
ulint arch_log_no = 0; /* since InnoDB does not archive
its own logs under MySQL, this
parameter is not relevant */
buf2 = ut_malloc(2 * UNIV_PAGE_SIZE); buf2 = ut_malloc(2 * UNIV_PAGE_SIZE);
/* Align the memory for a possible read from a raw device */ /* Align the memory for a possible read from a raw device */
buf = ut_align(buf2, UNIV_PAGE_SIZE); buf = ut_align(buf2, UNIV_PAGE_SIZE);
@ -1420,9 +1422,10 @@ fil_read_flushed_lsn_and_arch_log_no(
if (!one_read_already) { if (!one_read_already) {
*min_flushed_lsn = flushed_lsn; *min_flushed_lsn = flushed_lsn;
*max_flushed_lsn = flushed_lsn; *max_flushed_lsn = flushed_lsn;
#ifdef UNIV_LOG_ARCHIVE
*min_arch_log_no = arch_log_no; *min_arch_log_no = arch_log_no;
*max_arch_log_no = arch_log_no; *max_arch_log_no = arch_log_no;
#endif /* UNIV_LOG_ARCHIVE */
return; return;
} }
@ -1432,12 +1435,14 @@ fil_read_flushed_lsn_and_arch_log_no(
if (ut_dulint_cmp(*max_flushed_lsn, flushed_lsn) < 0) { if (ut_dulint_cmp(*max_flushed_lsn, flushed_lsn) < 0) {
*max_flushed_lsn = flushed_lsn; *max_flushed_lsn = flushed_lsn;
} }
#ifdef UNIV_LOG_ARCHIVE
if (*min_arch_log_no > arch_log_no) { if (*min_arch_log_no > arch_log_no) {
*min_arch_log_no = arch_log_no; *min_arch_log_no = arch_log_no;
} }
if (*max_arch_log_no < arch_log_no) { if (*max_arch_log_no < arch_log_no) {
*max_arch_log_no = arch_log_no; *max_arch_log_no = arch_log_no;
} }
#endif /* UNIV_LOG_ARCHIVE */
} }
/*================ SINGLE-TABLE TABLESPACES ==========================*/ /*================ SINGLE-TABLE TABLESPACES ==========================*/
@ -1507,33 +1512,31 @@ fil_decr_pending_ibuf_merges(
mutex_exit(&(system->mutex)); mutex_exit(&(system->mutex));
} }
/************************************************************
Creates the database directory for a table if it does not exist yet. */
static static
void void
fil_create_directory_for_tablename( fil_create_directory_for_tablename(
/*===============================*/ /*===============================*/
char* name) /* in: name in the standard 'databasename/tablename' const char* name) /* in: name in the standard
format */ 'databasename/tablename' format */
{ {
char* ptr; const char* namend;
char path[OS_FILE_MAX_PATH]; char* path;
ulint len;
sprintf(path, "%s/%s", fil_path_to_mysql_datadir, name); len = strlen(fil_path_to_mysql_datadir);
namend = strchr(name, '/');
ut_a(namend);
path = mem_alloc(len + (namend - name) + 2);
ptr = path + ut_strlen(path); memcpy(path, fil_path_to_mysql_datadir, len);
path[len] = '/';
while (*ptr != '/') { memcpy(path + len + 1, name, namend - name);
ptr--; path[len + (namend - name) + 1] = 0;
ut_a(ptr >= path);
}
*ptr = '\0';
srv_normalize_path_for_win(path); srv_normalize_path_for_win(path);
ut_a(os_file_create_directory(path, FALSE)); ut_a(os_file_create_directory(path, FALSE));
mem_free(path);
} }
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
@ -1615,10 +1618,10 @@ fil_op_log_parse_or_replay(
the tablespace in question; otherwise the tablespace in question; otherwise
ignored */ ignored */
{ {
ulint name_len; ulint name_len;
ulint new_name_len; ulint new_name_len;
char* name; const char* name;
char* new_name = NULL; const char* new_name = NULL;
if (end_ptr < ptr + 2) { if (end_ptr < ptr + 2) {
@ -1634,7 +1637,7 @@ fil_op_log_parse_or_replay(
return(NULL); return(NULL);
} }
name = (char*) ptr; name = (const char*) ptr;
ptr += name_len; ptr += name_len;
@ -1653,7 +1656,7 @@ fil_op_log_parse_or_replay(
return(NULL); return(NULL);
} }
new_name = (char*) ptr; new_name = (const char*) ptr;
ptr += new_name_len; ptr += new_name_len;
} }
@ -1916,11 +1919,11 @@ fil_rename_tablespace_in_mem(
/* out: TRUE if success */ /* out: TRUE if success */
fil_space_t* space, /* in: tablespace memory object */ fil_space_t* space, /* in: tablespace memory object */
fil_node_t* node, /* in: file node of that tablespace */ fil_node_t* node, /* in: file node of that tablespace */
char* path) /* in: new name */ const char* path) /* in: new name */
{ {
fil_system_t* system = fil_system; fil_system_t* system = fil_system;
fil_space_t* space2; fil_space_t* space2;
char* old_name = space->name; const char* old_name = space->name;
HASH_SEARCH(name_hash, system->name_hash, ut_fold_string(old_name), HASH_SEARCH(name_hash, system->name_hash, ut_fold_string(old_name),
space2, 0 == strcmp(old_name, space2->name)); space2, 0 == strcmp(old_name, space2->name));
@ -1945,11 +1948,8 @@ fil_rename_tablespace_in_mem(
mem_free(space->name); mem_free(space->name);
mem_free(node->name); mem_free(node->name);
space->name = mem_alloc(strlen(path) + 1); space->name = mem_strdup(path);
node->name = mem_alloc(strlen(path) + 1); node->name = mem_strdup(path);
strcpy(space->name, path);
strcpy(node->name, path);
HASH_INSERT(fil_space_t, name_hash, system->name_hash, HASH_INSERT(fil_space_t, name_hash, system->name_hash,
ut_fold_string(path), space); ut_fold_string(path), space);
@ -1985,7 +1985,7 @@ fil_rename_tablespace(
ut_a(id != 0); ut_a(id != 0);
if (old_name == NULL) { if (old_name == NULL) {
old_name = (char*)"(name not specified)"; old_name = "(name not specified)";
old_name_was_specified = FALSE; old_name_was_specified = FALSE;
} }
retry: retry:
@ -2532,9 +2532,9 @@ static
void void
fil_load_single_table_tablespace( fil_load_single_table_tablespace(
/*=============================*/ /*=============================*/
char* dbname, /* in: database name */ const char* dbname, /* in: database name */
char* filename) /* in: file name (not a path), including the const char* filename) /* in: file name (not a path),
.ibd extension */ including the .ibd extension */
{ {
os_file_t file; os_file_t file;
char* filepath; char* filepath;
@ -2732,7 +2732,7 @@ fil_load_single_table_tablespaces(void)
/* The datadir of MySQL is always the default directory of mysqld */ /* The datadir of MySQL is always the default directory of mysqld */
dir = os_file_opendir((char*) fil_path_to_mysql_datadir, TRUE); dir = os_file_opendir(fil_path_to_mysql_datadir, TRUE);
if (dir == NULL) { if (dir == NULL) {
@ -2744,7 +2744,7 @@ fil_load_single_table_tablespaces(void)
/* Scan all directories under the datadir. They are the database /* Scan all directories under the datadir. They are the database
directories of MySQL. */ directories of MySQL. */
ret = os_file_readdir_next_file((char*) fil_path_to_mysql_datadir, dir, ret = os_file_readdir_next_file(fil_path_to_mysql_datadir, dir,
&dbinfo); &dbinfo);
while (ret == 0) { while (ret == 0) {
/* printf("Looking at %s in datadir\n", dbinfo.name); */ /* printf("Looking at %s in datadir\n", dbinfo.name); */
@ -2805,7 +2805,7 @@ next_file_item:
} }
next_datadir_item: next_datadir_item:
ret = os_file_readdir_next_file((char*) fil_path_to_mysql_datadir, ret = os_file_readdir_next_file(fil_path_to_mysql_datadir,
dir, &dbinfo); dir, &dbinfo);
} }
@ -3066,7 +3066,7 @@ fil_get_space_id_for_table(
/*=======================*/ /*=======================*/
/* out: space id, ULINT_UNDEFINED if not /* out: space id, ULINT_UNDEFINED if not
found */ found */
char* name) /* in: table name in the standard const char* name) /* in: table name in the standard
'databasename/tablename' format */ 'databasename/tablename' format */
{ {
fil_system_t* system = fil_system; fil_system_t* system = fil_system;

View File

@ -211,7 +211,9 @@ ha_search_and_update_if_found(
{ {
ha_node_t* node; ha_node_t* node;
#ifdef UNIV_SYNC_DEBUG
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
#endif /* UNIV_SYNC_DEBUG */
node = ha_search_with_data(table, fold, data); node = ha_search_with_data(table, fold, data);

View File

@ -530,18 +530,18 @@ ibuf_data_init_for_space(
table = dict_mem_table_create(buf, space, 2); table = dict_mem_table_create(buf, space, 2);
dict_mem_table_add_col(table,(char *) "PAGE_NO", DATA_BINARY, 0, 0, 0); dict_mem_table_add_col(table, "PAGE_NO", DATA_BINARY, 0, 0, 0);
dict_mem_table_add_col(table,(char *) "TYPES", DATA_BINARY, 0, 0, 0); dict_mem_table_add_col(table, "TYPES", DATA_BINARY, 0, 0, 0);
table->id = ut_dulint_add(DICT_IBUF_ID_MIN, space); table->id = ut_dulint_add(DICT_IBUF_ID_MIN, space);
dict_table_add_to_cache(table); dict_table_add_to_cache(table);
index = dict_mem_index_create(buf, (char *) "CLUST_IND", space, index = dict_mem_index_create(buf, "CLUST_IND", space,
DICT_CLUSTERED | DICT_UNIVERSAL | DICT_IBUF,2); DICT_CLUSTERED | DICT_UNIVERSAL | DICT_IBUF,2);
dict_mem_index_add_field(index, (char *) "PAGE_NO", 0, 0); dict_mem_index_add_field(index, "PAGE_NO", 0, 0);
dict_mem_index_add_field(index, (char *) "TYPES", 0, 0); dict_mem_index_add_field(index, "TYPES", 0, 0);
index->page_no = FSP_IBUF_TREE_ROOT_PAGE_NO; index->page_no = FSP_IBUF_TREE_ROOT_PAGE_NO;

View File

@ -508,7 +508,7 @@ void
buf_block_buf_fix_inc_debug( buf_block_buf_fix_inc_debug(
/*========================*/ /*========================*/
buf_block_t* block, /* in: block to bufferfix */ buf_block_t* block, /* in: block to bufferfix */
char* file __attribute__ ((unused)), /* in: file name */ const char* file __attribute__ ((unused)), /* in: file name */
ulint line __attribute__ ((unused))) /* in: line */ ulint line __attribute__ ((unused))) /* in: line */
{ {
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG

View File

@ -248,10 +248,12 @@ fil_read_flushed_lsn_and_arch_log_no(
os_file_t data_file, /* in: open data file */ os_file_t data_file, /* in: open data file */
ibool one_read_already, /* in: TRUE if min and max parameters ibool one_read_already, /* in: TRUE if min and max parameters
below already contain sensible data */ below already contain sensible data */
dulint* min_flushed_lsn, /* in/out: */ #ifdef UNIV_LOG_ARCHIVE
ulint* min_arch_log_no, /* in/out: */ ulint* min_arch_log_no, /* in/out: */
dulint* max_flushed_lsn, /* in/out: */ ulint* max_arch_log_no, /* in/out: */
ulint* max_arch_log_no); /* in/out: */ #endif /* UNIV_LOG_ARCHIVE */
dulint* min_flushed_lsn, /* in/out: */
dulint* max_flushed_lsn); /* in/out: */
/*********************************************************************** /***********************************************************************
Increments the count of pending insert buffer page merges, if space is not Increments the count of pending insert buffer page merges, if space is not
being deleted. */ being deleted. */

View File

@ -15,7 +15,9 @@ Created 9/20/1997 Heikki Tuuri
#include "hash0hash.h" #include "hash0hash.h"
#include "log0log.h" #include "log0log.h"
#ifdef UNIV_HOTBACKUP
extern ibool recv_replay_file_ops; extern ibool recv_replay_file_ops;
#endif /* UNIV_HOTBACKUP */
/*********************************************************************** /***********************************************************************
Reads the checkpoint info needed in hot backup. */ Reads the checkpoint info needed in hot backup. */
@ -134,20 +136,25 @@ recv_reset_logs(
dulint lsn, /* in: reset to this lsn rounded up to dulint lsn, /* in: reset to this lsn rounded up to
be divisible by OS_FILE_LOG_BLOCK_SIZE, be divisible by OS_FILE_LOG_BLOCK_SIZE,
after which we add LOG_BLOCK_HDR_SIZE */ after which we add LOG_BLOCK_HDR_SIZE */
#ifdef UNIV_LOG_ARCHIVE
ulint arch_log_no, /* in: next archived log file number */ ulint arch_log_no, /* in: next archived log file number */
#endif /* UNIV_LOG_ARCHIVE */
ibool new_logs_created);/* in: TRUE if resetting logs is done ibool new_logs_created);/* in: TRUE if resetting logs is done
at the log creation; FALSE if it is done at the log creation; FALSE if it is done
after archive recovery */ after archive recovery */
#ifdef UNIV_HOTBACKUP
/********************************************************** /**********************************************************
Creates new log files after a backup has been restored. */ Creates new log files after a backup has been restored. */
void void
recv_reset_log_files_for_backup( recv_reset_log_files_for_backup(
/*============================*/ /*============================*/
char* log_dir, /* in: log file directory path */ const char* log_dir, /* in: log file directory path */
ulint n_log_files, /* in: number of log files */ ulint n_log_files, /* in: number of log files */
ulint log_file_size, /* in: log file size */ ulint log_file_size, /* in: log file size */
dulint lsn); /* in: new start lsn */ dulint lsn); /* in: new start lsn, must be
divisible by OS_FILE_LOG_BLOCK_SIZE */
#endif /* UNIV_HOTBACKUP */
/************************************************************ /************************************************************
Creates the recovery system. */ Creates the recovery system. */
@ -185,6 +192,7 @@ void
recv_apply_log_recs_for_backup(void); recv_apply_log_recs_for_backup(void);
/*================================*/ /*================================*/
#endif #endif
#ifdef UNIV_LOG_ARCHIVE
/************************************************************ /************************************************************
Recovers from archived log files, and also from log files, if they exist. */ Recovers from archived log files, and also from log files, if they exist. */
@ -205,6 +213,7 @@ Completes recovery from archive. */
void void
recv_recovery_from_archive_finish(void); recv_recovery_from_archive_finish(void);
/*===================================*/ /*===================================*/
#endif /* UNIV_LOG_ARCHIVE */
/*********************************************************************** /***********************************************************************
Checks that a replica of a space is identical to the original space. */ Checks that a replica of a space is identical to the original space. */
@ -333,7 +342,9 @@ extern ibool recv_no_ibuf_operations;
extern ibool recv_needed_recovery; extern ibool recv_needed_recovery;
extern ibool recv_lsn_checks_on; extern ibool recv_lsn_checks_on;
#ifdef UNIV_HOTBACKUP
extern ibool recv_is_making_a_backup; extern ibool recv_is_making_a_backup;
#endif /* UNIV_HOTBACKUP */
extern ulint recv_max_parsed_page_no; extern ulint recv_max_parsed_page_no;
/* Size of the parsing buffer; it must accommodate RECV_SCAN_SIZE many /* Size of the parsing buffer; it must accommodate RECV_SCAN_SIZE many

View File

@ -54,7 +54,7 @@ void
mem_hash_insert( mem_hash_insert(
/*============*/ /*============*/
mem_heap_t* heap, /* in: the created heap */ mem_heap_t* heap, /* in: the created heap */
char* file_name, /* in: file name of creation */ const char* file_name, /* in: file name of creation */
ulint line); /* in: line where created */ ulint line); /* in: line where created */
#ifdef UNIV_MEM_DEBUG #ifdef UNIV_MEM_DEBUG
/******************************************************************* /*******************************************************************
@ -70,7 +70,7 @@ void
mem_hash_remove( mem_hash_remove(
/*============*/ /*============*/
mem_heap_t* heap, /* in: the heap to be freed */ mem_heap_t* heap, /* in: the heap to be freed */
char* file_name, /* in: file name of freeing */ const char* file_name, /* in: file name of freeing */
ulint line); /* in: line where freed */ ulint line); /* in: line where freed */
#endif /* UNIV_MEM_DEBUG */ #endif /* UNIV_MEM_DEBUG */

View File

@ -16,10 +16,7 @@ Created 10/10/1995 Heikki Tuuri
#include "que0types.h" #include "que0types.h"
#include "trx0types.h" #include "trx0types.h"
extern char* srv_main_thread_op_info; extern const char* srv_main_thread_op_info;
/* 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 /* When this event is set the lock timeout and InnoDB monitor
thread starts running */ thread starts running */
@ -40,7 +37,9 @@ extern FILE* srv_monitor_file;
/* Server parameters which are read from the initfile */ /* Server parameters which are read from the initfile */
extern char* srv_data_home; extern char* srv_data_home;
#ifdef UNIV_LOG_ARCHIVE
extern char* srv_arch_dir; extern char* srv_arch_dir;
#endif /* UNIV_LOG_ARCHIVE */
extern ibool srv_file_per_table; extern ibool srv_file_per_table;
@ -62,7 +61,6 @@ extern char** srv_log_group_home_dirs;
extern ulint srv_n_log_groups; extern ulint srv_n_log_groups;
extern ulint srv_n_log_files; extern ulint srv_n_log_files;
extern ulint srv_log_file_size; extern ulint srv_log_file_size;
extern ibool srv_log_archive_on;
extern ulint srv_log_buffer_size; extern ulint srv_log_buffer_size;
extern ulint srv_flush_log_at_trx_commit; extern ulint srv_flush_log_at_trx_commit;
@ -75,8 +73,11 @@ extern ulint srv_lock_table_size;
extern ulint srv_n_file_io_threads; extern ulint srv_n_file_io_threads;
#ifdef UNIV_LOG_ARCHIVE
extern ibool srv_log_archive_on;
extern ibool srv_archive_recovery; extern ibool srv_archive_recovery;
extern dulint srv_archive_recovery_limit_lsn; extern dulint srv_archive_recovery_limit_lsn;
#endif /* UNIV_LOG_ARCHIVE */
extern ulint srv_lock_wait_timeout; extern ulint srv_lock_wait_timeout;

View File

@ -30,7 +30,7 @@ rw_lock_add_debug_info(
rw_lock_t* lock, /* in: rw-lock */ rw_lock_t* lock, /* in: rw-lock */
ulint pass, /* in: pass value */ ulint pass, /* in: pass value */
ulint lock_type, /* in: lock type */ ulint lock_type, /* in: lock type */
char* file_name, /* in: file where requested */ const char* file_name, /* in: file where requested */
ulint line); /* in: line where requested */ ulint line); /* in: line where requested */
/********************************************************************** /**********************************************************************
Removes a debug information struct for an rw-lock. */ Removes a debug information struct for an rw-lock. */

View File

@ -33,7 +33,7 @@ void
mutex_set_debug_info( mutex_set_debug_info(
/*=================*/ /*=================*/
mutex_t* mutex, /* in: mutex */ mutex_t* mutex, /* in: mutex */
char* file_name, /* in: file where requested */ const char* file_name, /* in: file where requested */
ulint line); /* in: line where requested */ ulint line); /* in: line where requested */
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
/********************************************************************** /**********************************************************************

View File

@ -41,9 +41,11 @@ old */
ibool log_has_printed_chkp_warning = FALSE; ibool log_has_printed_chkp_warning = FALSE;
time_t log_last_warning_time; time_t log_last_warning_time;
#ifdef UNIV_LOG_ARCHIVE
/* Pointer to this variable is used as the i/o-message when we do i/o to an /* Pointer to this variable is used as the i/o-message when we do i/o to an
archive */ archive */
byte log_archive_io; byte log_archive_io;
#endif /* UNIV_LOG_ARCHIVE */
/* A margin for free space in the log buffer before a log entry is catenated */ /* A margin for free space in the log buffer before a log entry is catenated */
#define LOG_BUF_WRITE_MARGIN (4 * OS_FILE_LOG_BLOCK_SIZE) #define LOG_BUF_WRITE_MARGIN (4 * OS_FILE_LOG_BLOCK_SIZE)
@ -90,12 +92,14 @@ static
void void
log_io_complete_checkpoint(void); log_io_complete_checkpoint(void);
/*============================*/ /*============================*/
#ifdef UNIV_LOG_ARCHIVE
/********************************************************** /**********************************************************
Completes an archiving i/o. */ Completes an archiving i/o. */
static static
void void
log_io_complete_archive(void); log_io_complete_archive(void);
/*=========================*/ /*=========================*/
#endif /* UNIV_LOG_ARCHIVE */
/******************************************************************** /********************************************************************
Sets the global variable log_fsp_current_free_limit. Also makes a checkpoint, Sets the global variable log_fsp_current_free_limit. Also makes a checkpoint,
@ -160,9 +164,13 @@ log_reserve_and_open(
{ {
log_t* log = log_sys; log_t* log = log_sys;
ulint len_upper_limit; ulint len_upper_limit;
#ifdef UNIV_LOG_ARCHIVE
ulint archived_lsn_age; ulint archived_lsn_age;
ulint count = 0;
ulint dummy; ulint dummy;
#endif /* UNIV_LOG_ARCHIVE */
#ifdef UNIV_DEBUG
ulint count = 0;
#endif /* UNIV_DEBUG */
ut_a(len < log->buf_size / 2); ut_a(len < log->buf_size / 2);
loop: loop:
@ -182,13 +190,12 @@ loop:
log_buffer_flush_to_disk(); log_buffer_flush_to_disk();
count++; ut_ad(++count < 50);
ut_ad(count < 50);
goto loop; goto loop;
} }
#ifdef UNIV_LOG_ARCHIVE
if (log->archiving_state != LOG_ARCH_OFF) { if (log->archiving_state != LOG_ARCH_OFF) {
archived_lsn_age = ut_dulint_minus(log->lsn, archived_lsn_age = ut_dulint_minus(log->lsn,
@ -204,13 +211,12 @@ loop:
log_archive_do(TRUE, &dummy); log_archive_do(TRUE, &dummy);
count++; ut_ad(++count < 50);
ut_ad(count < 50);
goto loop; goto loop;
} }
} }
#endif /* UNIV_LOG_ARCHIVE */
#ifdef UNIV_LOG_DEBUG #ifdef UNIV_LOG_DEBUG
log->old_buf_free = log->buf_free; log->old_buf_free = log->buf_free;
@ -378,6 +384,7 @@ function_exit:
return(lsn); return(lsn);
} }
#ifdef UNIV_LOG_ARCHIVE
/********************************************************** /**********************************************************
Pads the current log block full with dummy log records. Used in producing Pads the current log block full with dummy log records. Used in producing
consistent archived log files. */ consistent archived log files. */
@ -410,6 +417,7 @@ log_pad_current_log_block(void)
ut_a((ut_dulint_get_low(lsn) % OS_FILE_LOG_BLOCK_SIZE) ut_a((ut_dulint_get_low(lsn) % OS_FILE_LOG_BLOCK_SIZE)
== LOG_BLOCK_HDR_SIZE); == LOG_BLOCK_HDR_SIZE);
} }
#endif /* UNIV_LOG_ARCHIVE */
/********************************************************** /**********************************************************
Calculates the data capacity of a log group, when the log file headers are not Calculates the data capacity of a log group, when the log file headers are not
@ -663,11 +671,13 @@ log_calc_max_ages(void)
/ LOG_POOL_CHECKPOINT_RATIO_ASYNC; / LOG_POOL_CHECKPOINT_RATIO_ASYNC;
log_sys->max_checkpoint_age = margin; log_sys->max_checkpoint_age = margin;
#ifdef UNIV_LOG_ARCHIVE
log_sys->max_archived_lsn_age = smallest_archive_margin; log_sys->max_archived_lsn_age = smallest_archive_margin;
log_sys->max_archived_lsn_age_async = smallest_archive_margin log_sys->max_archived_lsn_age_async = smallest_archive_margin
- smallest_archive_margin / - smallest_archive_margin /
LOG_ARCHIVE_RATIO_ASYNC; LOG_ARCHIVE_RATIO_ASYNC;
#endif /* UNIV_LOG_ARCHIVE */
failure: failure:
mutex_exit(&(log_sys->mutex)); mutex_exit(&(log_sys->mutex));
@ -767,6 +777,7 @@ log_init(void)
memset(log_sys->checkpoint_buf, '\0', OS_FILE_LOG_BLOCK_SIZE); memset(log_sys->checkpoint_buf, '\0', OS_FILE_LOG_BLOCK_SIZE);
/*----------------------------*/ /*----------------------------*/
#ifdef UNIV_LOG_ARCHIVE
/* Under MySQL, log archiving is always off */ /* Under MySQL, log archiving is always off */
log_sys->archiving_state = LOG_ARCH_OFF; log_sys->archiving_state = LOG_ARCH_OFF;
log_sys->archived_lsn = log_sys->lsn; log_sys->archived_lsn = log_sys->lsn;
@ -788,6 +799,7 @@ log_init(void)
/* memset(log_sys->archive_buf, '\0', LOG_ARCHIVE_BUF_SIZE); */ /* memset(log_sys->archive_buf, '\0', LOG_ARCHIVE_BUF_SIZE); */
log_sys->archiving_on = os_event_create(NULL); log_sys->archiving_on = os_event_create(NULL);
#endif /* UNIV_LOG_ARCHIVE */
/*----------------------------*/ /*----------------------------*/
@ -823,7 +835,8 @@ log_group_init(
ulint space_id, /* in: space id of the file space ulint space_id, /* in: space id of the file space
which contains the log files of this which contains the log files of this
group */ group */
ulint archive_space_id) /* in: space id of the file space ulint archive_space_id __attribute__((unused)))
/* in: space id of the file space
which contains some archived log which contains some archived log
files for this group; currently, only files for this group; currently, only
for the first log group this is for the first log group this is
@ -845,7 +858,9 @@ log_group_init(
group->n_pending_writes = 0; group->n_pending_writes = 0;
group->file_header_bufs = mem_alloc(sizeof(byte*) * n_files); group->file_header_bufs = mem_alloc(sizeof(byte*) * n_files);
#ifdef UNIV_LOG_ARCHIVE
group->archive_file_header_bufs = mem_alloc(sizeof(byte*) * n_files); group->archive_file_header_bufs = mem_alloc(sizeof(byte*) * n_files);
#endif /* UNIV_LOG_ARCHIVE */
for (i = 0; i < n_files; i++) { for (i = 0; i < n_files; i++) {
*(group->file_header_bufs + i) = ut_align( *(group->file_header_bufs + i) = ut_align(
@ -855,17 +870,21 @@ log_group_init(
memset(*(group->file_header_bufs + i), '\0', memset(*(group->file_header_bufs + i), '\0',
LOG_FILE_HDR_SIZE); LOG_FILE_HDR_SIZE);
#ifdef UNIV_LOG_ARCHIVE
*(group->archive_file_header_bufs + i) = ut_align( *(group->archive_file_header_bufs + i) = ut_align(
mem_alloc(LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE), mem_alloc(LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE),
OS_FILE_LOG_BLOCK_SIZE); OS_FILE_LOG_BLOCK_SIZE);
memset(*(group->archive_file_header_bufs + i), '\0', memset(*(group->archive_file_header_bufs + i), '\0',
LOG_FILE_HDR_SIZE); LOG_FILE_HDR_SIZE);
#endif /* UNIV_LOG_ARCHIVE */
} }
#ifdef UNIV_LOG_ARCHIVE
group->archive_space_id = archive_space_id; group->archive_space_id = archive_space_id;
group->archived_file_no = 0; group->archived_file_no = 0;
group->archived_offset = 0; group->archived_offset = 0;
#endif /* UNIV_LOG_ARCHIVE */
group->checkpoint_buf = ut_align( group->checkpoint_buf = ut_align(
mem_alloc(2 * OS_FILE_LOG_BLOCK_SIZE), mem_alloc(2 * OS_FILE_LOG_BLOCK_SIZE),
@ -1002,6 +1021,7 @@ log_io_complete(
{ {
ulint unlock; ulint unlock;
#ifdef UNIV_LOG_ARCHIVE
if ((byte*)group == &log_archive_io) { if ((byte*)group == &log_archive_io) {
/* It was an archive write */ /* It was an archive write */
@ -1009,6 +1029,7 @@ log_io_complete(
return; return;
} }
#endif /* UNIV_LOG_ARCHIVE */
if ((ulint)group & 0x1UL) { if ((ulint)group & 0x1UL) {
/* It was a checkpoint write */ /* It was a checkpoint write */
@ -1189,7 +1210,7 @@ loop:
(ulong) group->id, (ulong) next_offset, (ulong) group->id, (ulong) next_offset,
(ulong) write_len, (ulong) write_len,
(ulong) ut_dulint_get_high(start_lsn), (ulong) ut_dulint_get_high(start_lsn),
(ulong) ut_dulint_get_low(start_lsn). (ulong) ut_dulint_get_low(start_lsn),
(ulong) log_block_get_hdr_no(buf), (ulong) log_block_get_hdr_no(buf),
(ulong) log_block_get_hdr_no( (ulong) log_block_get_hdr_no(
buf + write_len - OS_FILE_LOG_BLOCK_SIZE)); buf + write_len - OS_FILE_LOG_BLOCK_SIZE));
@ -1629,8 +1650,10 @@ log_group_checkpoint(
log_group_t* group) /* in: log group */ log_group_t* group) /* in: log group */
{ {
log_group_t* group2; log_group_t* group2;
#ifdef UNIV_LOG_ARCHIVE
dulint archived_lsn; dulint archived_lsn;
dulint next_archived_lsn; dulint next_archived_lsn;
#endif /* UNIV_LOG_ARCHIVE */
ulint write_offset; ulint write_offset;
ulint fold; ulint fold;
byte* buf; byte* buf;
@ -1653,6 +1676,7 @@ log_group_checkpoint(
mach_write_to_4(buf + LOG_CHECKPOINT_LOG_BUF_SIZE, log_sys->buf_size); mach_write_to_4(buf + LOG_CHECKPOINT_LOG_BUF_SIZE, log_sys->buf_size);
#ifdef UNIV_LOG_ARCHIVE
if (log_sys->archiving_state == LOG_ARCH_OFF) { if (log_sys->archiving_state == LOG_ARCH_OFF) {
archived_lsn = ut_dulint_max; archived_lsn = ut_dulint_max;
} else { } else {
@ -1664,8 +1688,11 @@ log_group_checkpoint(
/* For debugging only */ /* For debugging only */
} }
} }
mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn); mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn);
#else /* UNIV_LOG_ARCHIVE */
mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, ut_dulint_max);
#endif /* UNIV_LOG_ARCHIVE */
for (i = 0; i < LOG_MAX_N_GROUPS; i++) { for (i = 0; i < LOG_MAX_N_GROUPS; i++) {
log_checkpoint_set_nth_group_info(buf, i, 0, 0); log_checkpoint_set_nth_group_info(buf, i, 0, 0);
@ -1675,8 +1702,13 @@ log_group_checkpoint(
while (group2) { while (group2) {
log_checkpoint_set_nth_group_info(buf, group2->id, log_checkpoint_set_nth_group_info(buf, group2->id,
#ifdef UNIV_LOG_ARCHIVE
group2->archived_file_no, group2->archived_file_no,
group2->archived_offset); group2->archived_offset
#else /* UNIV_LOG_ARCHIVE */
0, 0
#endif /* UNIV_LOG_ARCHIVE */
);
group2 = UT_LIST_GET_NEXT(log_groups, group2); group2 = UT_LIST_GET_NEXT(log_groups, group2);
} }
@ -2102,16 +2134,18 @@ loop:
len = group->file_size - (source_offset % group->file_size); len = group->file_size - (source_offset % group->file_size);
} }
#ifdef UNIV_LOG_ARCHIVE
if (type == LOG_ARCHIVE) { if (type == LOG_ARCHIVE) {
log_sys->n_pending_archive_ios++; log_sys->n_pending_archive_ios++;
} }
#endif /* UNIV_LOG_ARCHIVE */
log_sys->n_log_ios++; log_sys->n_log_ios++;
fil_io(OS_FILE_READ | OS_FILE_LOG, sync, group->space_id, fil_io(OS_FILE_READ | OS_FILE_LOG, sync, group->space_id,
source_offset / UNIV_PAGE_SIZE, source_offset % UNIV_PAGE_SIZE, source_offset / UNIV_PAGE_SIZE, source_offset % UNIV_PAGE_SIZE,
len, buf, &log_archive_io); len, buf, NULL);
start_lsn = ut_dulint_add(start_lsn, len); start_lsn = ut_dulint_add(start_lsn, len);
buf += len; buf += len;
@ -2122,6 +2156,7 @@ loop:
} }
} }
#ifdef UNIV_LOG_ARCHIVE
/********************************************************** /**********************************************************
Generates an archived log file name. */ Generates an archived log file name. */
@ -2134,8 +2169,6 @@ log_archived_file_name_gen(
currently we only archive the first group */ currently we only archive the first group */
ulint file_no)/* in: file number */ ulint file_no)/* in: file number */
{ {
ut_a(0);
sprintf(buf, "%sib_arch_log_%010lu", srv_arch_dir, (ulong) file_no); sprintf(buf, "%sib_arch_log_%010lu", srv_arch_dir, (ulong) file_no);
} }
@ -2156,8 +2189,6 @@ log_group_archive_file_header_write(
ulint dest_offset; ulint dest_offset;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex))); ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
@ -2197,8 +2228,6 @@ log_group_archive_completed_header_write(
ulint dest_offset; ulint dest_offset;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex))); ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
ut_a(nth_file < group->n_files); ut_a(nth_file < group->n_files);
@ -2240,8 +2269,6 @@ log_group_archive(
ulint open_mode; ulint open_mode;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex))); ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
@ -2372,8 +2399,6 @@ log_archive_groups(void)
log_group_t* group; log_group_t* group;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex))); ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
@ -2399,8 +2424,6 @@ log_archive_write_complete_groups(void)
ulint i; ulint i;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex))); ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
@ -2470,8 +2493,6 @@ log_archive_check_completion_low(void)
/*==================================*/ /*==================================*/
{ {
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex))); ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
@ -2511,8 +2532,6 @@ log_io_complete_archive(void)
{ {
log_group_t* group; log_group_t* group;
ut_a(0);
mutex_enter(&(log_sys->mutex)); mutex_enter(&(log_sys->mutex));
group = UT_LIST_GET_FIRST(log_sys->log_groups); group = UT_LIST_GET_FIRST(log_sys->log_groups);
@ -2548,8 +2567,6 @@ log_archive_do(
dulint start_lsn; dulint start_lsn;
dulint limit_lsn; dulint limit_lsn;
ut_a(0);
calc_new_limit = TRUE; calc_new_limit = TRUE;
loop: loop:
mutex_enter(&(log_sys->mutex)); mutex_enter(&(log_sys->mutex));
@ -2678,8 +2695,6 @@ log_archive_all(void)
return; return;
} }
ut_a(0);
present_lsn = log_sys->lsn; present_lsn = log_sys->lsn;
mutex_exit(&(log_sys->mutex)); mutex_exit(&(log_sys->mutex));
@ -2724,8 +2739,6 @@ log_archive_close_groups(
return; return;
} }
ut_a(0);
group = UT_LIST_GET_FIRST(log_sys->log_groups); group = UT_LIST_GET_FIRST(log_sys->log_groups);
trunc_len = UNIV_PAGE_SIZE trunc_len = UNIV_PAGE_SIZE
@ -2770,8 +2783,6 @@ log_archive_stop(void)
{ {
ibool success; ibool success;
ut_a(0);
mutex_enter(&(log_sys->mutex)); mutex_enter(&(log_sys->mutex));
if (log_sys->archiving_state != LOG_ARCH_ON) { if (log_sys->archiving_state != LOG_ARCH_ON) {
@ -2834,8 +2845,6 @@ log_archive_start(void)
/*===================*/ /*===================*/
/* out: DB_SUCCESS or DB_ERROR */ /* out: DB_SUCCESS or DB_ERROR */
{ {
ut_a(0);
mutex_enter(&(log_sys->mutex)); mutex_enter(&(log_sys->mutex));
if (log_sys->archiving_state != LOG_ARCH_STOPPED) { if (log_sys->archiving_state != LOG_ARCH_STOPPED) {
@ -2862,7 +2871,6 @@ log_archive_noarchivelog(void)
/*==========================*/ /*==========================*/
/* out: DB_SUCCESS or DB_ERROR */ /* out: DB_SUCCESS or DB_ERROR */
{ {
ut_a(0);
loop: loop:
mutex_enter(&(log_sys->mutex)); mutex_enter(&(log_sys->mutex));
@ -2895,7 +2903,6 @@ log_archive_archivelog(void)
/*========================*/ /*========================*/
/* out: DB_SUCCESS or DB_ERROR */ /* out: DB_SUCCESS or DB_ERROR */
{ {
ut_a(0);
mutex_enter(&(log_sys->mutex)); mutex_enter(&(log_sys->mutex));
if (log_sys->archiving_state == LOG_ARCH_OFF) { if (log_sys->archiving_state == LOG_ARCH_OFF) {
@ -2914,7 +2921,6 @@ log_archive_archivelog(void)
return(DB_ERROR); return(DB_ERROR);
} }
#ifdef notdefined
/******************************************************************** /********************************************************************
Tries to establish a big enough margin of free space in the log groups, such Tries to establish a big enough margin of free space in the log groups, such
that a new log entry can be catenated without an immediate need for that a new log entry can be catenated without an immediate need for
@ -2968,7 +2974,7 @@ loop:
goto loop; goto loop;
} }
} }
#endif #endif /* UNIV_LOG_ARCHIVE */
/************************************************************************ /************************************************************************
Checks that there is enough free space in the log to start a new query step. Checks that there is enough free space in the log to start a new query step.
@ -2985,7 +2991,9 @@ loop:
log_checkpoint_margin(); log_checkpoint_margin();
/* log_archive_margin(); */ #ifdef UNIV_LOG_ARCHIVE
log_archive_margin();
#endif /* UNIV_LOG_ARCHIVE */
mutex_enter(&(log_sys->mutex)); mutex_enter(&(log_sys->mutex));
@ -3047,9 +3055,12 @@ loop:
mutex_enter(&(log_sys->mutex)); mutex_enter(&(log_sys->mutex));
if (log_sys->n_pending_archive_ios if (
+ log_sys->n_pending_checkpoint_writes #ifdef UNIV_LOG_ARCHIVE
+ log_sys->n_pending_writes > 0) { log_sys->n_pending_archive_ios ||
#endif /* UNIV_LOG_ARCHIVE */
log_sys->n_pending_checkpoint_writes ||
log_sys->n_pending_writes) {
mutex_exit(&(log_sys->mutex)); mutex_exit(&(log_sys->mutex));
@ -3063,7 +3074,9 @@ loop:
goto loop; goto loop;
} }
/* log_archive_all(); */ #ifdef UNIV_LOG_ARCHIVE
log_archive_all();
#endif /* UNIV_LOG_ARCHIVE */
log_make_checkpoint_at(ut_dulint_max, TRUE); log_make_checkpoint_at(ut_dulint_max, TRUE);
mutex_enter(&(log_sys->mutex)); mutex_enter(&(log_sys->mutex));
@ -3071,10 +3084,13 @@ loop:
lsn = log_sys->lsn; lsn = log_sys->lsn;
if (ut_dulint_cmp(lsn, log_sys->last_checkpoint_lsn) != 0 if (ut_dulint_cmp(lsn, log_sys->last_checkpoint_lsn) != 0
#ifdef UNIV_LOG_ARCHIVE
|| (srv_log_archive_on || (srv_log_archive_on
&& ut_dulint_cmp(lsn, && ut_dulint_cmp(lsn,
ut_dulint_add(log_sys->archived_lsn, LOG_BLOCK_HDR_SIZE)) ut_dulint_add(log_sys->archived_lsn, LOG_BLOCK_HDR_SIZE))
!= 0)) { != 0)
#endif /* UNIV_LOG_ARCHIVE */
) {
mutex_exit(&(log_sys->mutex)); mutex_exit(&(log_sys->mutex));
@ -3082,15 +3098,17 @@ loop:
} }
arch_log_no = 0; arch_log_no = 0;
/*
UT_LIST_GET_FIRST(log_sys->log_groups)->archived_file_no; #ifdef UNIV_LOG_ARCHIVE
UT_LIST_GET_FIRST(log_sys->log_groups)->archived_file_no;
if (0 == UT_LIST_GET_FIRST(log_sys->log_groups)->archived_offset) { if (0 == UT_LIST_GET_FIRST(log_sys->log_groups)->archived_offset) {
arch_log_no--; arch_log_no--;
} }
*/
/* log_archive_close_groups(TRUE); */ log_archive_close_groups(TRUE);
#endif /* UNIV_LOG_ARCHIVE */
mutex_exit(&(log_sys->mutex)); mutex_exit(&(log_sys->mutex));
@ -3228,8 +3246,7 @@ log_peek_lsn(
log system mutex */ log system mutex */
dulint* lsn) /* out: if returns TRUE, current lsn is here */ dulint* lsn) /* out: if returns TRUE, current lsn is here */
{ {
if (0 == mutex_enter_nowait(&(log_sys->mutex), (char*)__FILE__, if (0 == mutex_enter_nowait(&(log_sys->mutex), __FILE__, __LINE__)) {
__LINE__)) {
*lsn = log_sys->lsn; *lsn = log_sys->lsn;
mutex_exit(&(log_sys->mutex)); mutex_exit(&(log_sys->mutex));

View File

@ -34,10 +34,12 @@ Created 9/20/1997 Heikki Tuuri
#include "dict0boot.h" #include "dict0boot.h"
#include "fil0fil.h" #include "fil0fil.h"
#ifdef UNIV_HOTBACKUP
/* This is set to FALSE if the backup was originally taken with the /* This is set to FALSE if the backup was originally taken with the
ibbackup --include regexp option: then we do not want to create tables in ibbackup --include regexp option: then we do not want to create tables in
directories which were not included */ directories which were not included */
ibool recv_replay_file_ops = TRUE; ibool recv_replay_file_ops = TRUE;
#endif /* UNIV_HOTBACKUP */
/* Log records are stored in the hash table in chunks at most of this size; /* Log records are stored in the hash table in chunks at most of this size;
this must be less than UNIV_PAGE_SIZE as it is stored in the buffer pool */ this must be less than UNIV_PAGE_SIZE as it is stored in the buffer pool */
@ -71,7 +73,11 @@ log scan */
ulint recv_scan_print_counter = 0; ulint recv_scan_print_counter = 0;
ibool recv_is_from_backup = FALSE; ibool recv_is_from_backup = FALSE;
#ifdef UNIV_HOTBACKUP
ibool recv_is_making_a_backup = FALSE; ibool recv_is_making_a_backup = FALSE;
#else
# define recv_is_making_a_backup FALSE
#endif /* UNIV_HOTBACKUP */
ulint recv_previous_parsed_rec_type = 999999; ulint recv_previous_parsed_rec_type = 999999;
ulint recv_previous_parsed_rec_offset = 0; ulint recv_previous_parsed_rec_offset = 0;
@ -1516,9 +1522,9 @@ skip_this_recv_addr:
recv_sys_empty_hash(); recv_sys_empty_hash();
} }
#endif #endif /* UNIV_HOTBACKUP */
#ifdef notdefined #ifdef UNIV_LOG_REPLICATE
/*********************************************************************** /***********************************************************************
In the debug version, updates the replica of a file page, based on a log In the debug version, updates the replica of a file page, based on a log
record. */ record. */
@ -1718,7 +1724,7 @@ recv_compare_spaces_low(
recv_compare_spaces(space1, space2, n_pages); recv_compare_spaces(space1, space2, n_pages);
} }
#endif #endif /* UNIV_LOG_REPLICATE */
/*********************************************************************** /***********************************************************************
Tries to parse a single log record and returns its length. */ Tries to parse a single log record and returns its length. */
@ -2018,11 +2024,13 @@ loop:
becomes identical with the original page */ becomes identical with the original page */
#ifdef UNIV_LOG_DEBUG #ifdef UNIV_LOG_DEBUG
recv_check_incomplete_log_recs(ptr, len); recv_check_incomplete_log_recs(ptr, len);
#endif #endif/* UNIV_LOG_DEBUG */
/* recv_update_replicate(type, space, page_no, body, #ifdef UNIV_LOG_REPLICATE
recv_update_replicate(type, space, page_no, body,
ptr + len); ptr + len);
recv_compare_replicate(space, page_no); recv_compare_replicate(space, page_no);
*/ #endif /* UNIV_LOG_REPLICATE */
} }
} else { } else {
/* Check that all the records associated with the single mtr /* Check that all the records associated with the single mtr
@ -2055,11 +2063,11 @@ loop:
according to the log record */ according to the log record */
#ifdef UNIV_LOG_DEBUG #ifdef UNIV_LOG_DEBUG
recv_check_incomplete_log_recs(ptr, len); recv_check_incomplete_log_recs(ptr, len);
#endif #endif /* UNIV_LOG_DEBUG */
/* #ifdef UNIV_LOG_REPLICATE
recv_update_replicate(type, space, page_no, recv_update_replicate(type, space, page_no,
body, ptr + len); body, ptr + len);
*/ #endif /* UNIV_LOG_REPLICATE */
} }
#ifdef UNIV_LOG_DEBUG #ifdef UNIV_LOG_DEBUG
@ -2127,12 +2135,13 @@ loop:
recv_add_to_hash_table(type, space, page_no, recv_add_to_hash_table(type, space, page_no,
body, ptr + len, old_lsn, body, ptr + len, old_lsn,
new_recovered_lsn); new_recovered_lsn);
#ifdef UNIV_LOG_REPLICATE
} else { } else {
/* In debug checking, check that the replicate /* In debug checking, check that the replicate
page has become identical with the original page has become identical with the original
page */ page */
recv_compare_replicate(space, page_no);
/* recv_compare_replicate(space, page_no); */ #endif /* UNIV_LOG_REPLICATE */
} }
ptr += len; ptr += len;
@ -2576,15 +2585,16 @@ recv_recovery_from_checkpoint_start(
/* Wipe over the label now */ /* Wipe over the label now */
ut_memcpy(log_hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, memset(log_hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP,
(char*)" ", 4); ' ', 4);
/* Write to the log file to wipe over the label */ /* Write to the log file to wipe over the label */
fil_io(OS_FILE_WRITE | OS_FILE_LOG, TRUE, fil_io(OS_FILE_WRITE | OS_FILE_LOG, TRUE,
max_cp_group->space_id, max_cp_group->space_id,
0, 0, OS_FILE_LOG_BLOCK_SIZE, 0, 0, OS_FILE_LOG_BLOCK_SIZE,
log_hdr_buf, max_cp_group); log_hdr_buf, max_cp_group);
} }
#ifdef UNIV_LOG_ARCHIVE
group = UT_LIST_GET_FIRST(log_sys->log_groups); group = UT_LIST_GET_FIRST(log_sys->log_groups);
while (group) { while (group) {
@ -2594,6 +2604,7 @@ recv_recovery_from_checkpoint_start(
group = UT_LIST_GET_NEXT(log_groups, group); group = UT_LIST_GET_NEXT(log_groups, group);
} }
#endif /* UNIV_LOG_ARCHIVE */
if (type == LOG_CHECKPOINT) { if (type == LOG_CHECKPOINT) {
/* Start reading the log groups from the checkpoint lsn up. The /* Start reading the log groups from the checkpoint lsn up. The
@ -2789,7 +2800,9 @@ recv_recovery_from_checkpoint_start(
log_sys->next_checkpoint_lsn = checkpoint_lsn; log_sys->next_checkpoint_lsn = checkpoint_lsn;
log_sys->next_checkpoint_no = ut_dulint_add(checkpoint_no, 1); log_sys->next_checkpoint_no = ut_dulint_add(checkpoint_no, 1);
#ifdef UNIV_LOG_ARCHIVE
log_sys->archived_lsn = archived_lsn; log_sys->archived_lsn = archived_lsn;
#endif /* UNIV_LOG_ARCHIVE */
recv_synchronize_groups(up_to_date_group); recv_synchronize_groups(up_to_date_group);
@ -2822,10 +2835,12 @@ recv_recovery_from_checkpoint_start(
log_sys->next_checkpoint_no = ut_dulint_add(checkpoint_no, 1); log_sys->next_checkpoint_no = ut_dulint_add(checkpoint_no, 1);
#ifdef UNIV_LOG_ARCHIVE
if (ut_dulint_cmp(archived_lsn, ut_dulint_max) == 0) { if (ut_dulint_cmp(archived_lsn, ut_dulint_max) == 0) {
log_sys->archiving_state = LOG_ARCH_OFF; log_sys->archiving_state = LOG_ARCH_OFF;
} }
#endif /* UNIV_LOG_ARCHIVE */
mutex_enter(&(recv_sys->mutex)); mutex_enter(&(recv_sys->mutex));
@ -2904,7 +2919,9 @@ recv_reset_logs(
dulint lsn, /* in: reset to this lsn rounded up to dulint lsn, /* in: reset to this lsn rounded up to
be divisible by OS_FILE_LOG_BLOCK_SIZE, be divisible by OS_FILE_LOG_BLOCK_SIZE,
after which we add LOG_BLOCK_HDR_SIZE */ after which we add LOG_BLOCK_HDR_SIZE */
#ifdef UNIV_LOG_ARCHIVE
ulint arch_log_no, /* in: next archived log file number */ ulint arch_log_no, /* in: next archived log file number */
#endif /* UNIV_LOG_ARCHIVE */
ibool new_logs_created)/* in: TRUE if resetting logs is done ibool new_logs_created)/* in: TRUE if resetting logs is done
at the log creation; FALSE if it is done at the log creation; FALSE if it is done
after archive recovery */ after archive recovery */
@ -2921,9 +2938,10 @@ recv_reset_logs(
while (group) { while (group) {
group->lsn = log_sys->lsn; group->lsn = log_sys->lsn;
group->lsn_offset = LOG_FILE_HDR_SIZE; group->lsn_offset = LOG_FILE_HDR_SIZE;
#ifdef UNIV_LOG_ARCHIVE
group->archived_file_no = arch_log_no; group->archived_file_no = arch_log_no;
group->archived_offset = 0; group->archived_offset = 0;
#endif /* UNIV_LOG_ARCHIVE */
if (!new_logs_created) { if (!new_logs_created) {
recv_truncate_group(group, group->lsn, group->lsn, recv_truncate_group(group, group->lsn, group->lsn,
@ -2940,7 +2958,9 @@ recv_reset_logs(
log_sys->next_checkpoint_no = ut_dulint_zero; log_sys->next_checkpoint_no = ut_dulint_zero;
log_sys->last_checkpoint_lsn = ut_dulint_zero; log_sys->last_checkpoint_lsn = ut_dulint_zero;
#ifdef UNIV_LOG_ARCHIVE
log_sys->archived_lsn = log_sys->lsn; log_sys->archived_lsn = log_sys->lsn;
#endif /* UNIV_LOG_ARCHIVE */
log_block_init(log_sys->buf, log_sys->lsn); log_block_init(log_sys->buf, log_sys->lsn);
log_block_set_first_rec_group(log_sys->buf, LOG_BLOCK_HDR_SIZE); log_block_set_first_rec_group(log_sys->buf, LOG_BLOCK_HDR_SIZE);
@ -2958,17 +2978,18 @@ recv_reset_logs(
mutex_enter(&(log_sys->mutex)); mutex_enter(&(log_sys->mutex));
} }
#ifdef UNIV_HOTBACKUP
/********************************************************** /**********************************************************
Creates new log files after a backup has been restored. */ Creates new log files after a backup has been restored. */
void void
recv_reset_log_files_for_backup( recv_reset_log_files_for_backup(
/*============================*/ /*============================*/
char* log_dir, /* in: log file directory path */ const char* log_dir, /* in: log file directory path */
ulint n_log_files, /* in: number of log files */ ulint n_log_files, /* in: number of log files */
ulint log_file_size, /* in: log file size */ ulint log_file_size, /* in: log file size */
dulint lsn) /* in: new start lsn, must be divisible by dulint lsn) /* in: new start lsn, must be
OS_FILE_LOG_BLOCK_SIZE */ divisible by OS_FILE_LOG_BLOCK_SIZE */
{ {
os_file_t log_file; os_file_t log_file;
ibool success; ibool success;
@ -2976,8 +2997,8 @@ recv_reset_log_files_for_backup(
ulint i; ulint i;
ulint log_dir_len; ulint log_dir_len;
char* name; char* name;
static static const
char logfilename[] = "ib_logfile"; char logfilename[] = "ib_logfile";
log_dir_len = strlen(log_dir); log_dir_len = strlen(log_dir);
/* reserve space for log_dir, "ib_logfile" and a number */ /* reserve space for log_dir, "ib_logfile" and a number */
@ -3047,7 +3068,9 @@ recv_reset_log_files_for_backup(
mem_free(name); mem_free(name);
ut_free(buf); ut_free(buf);
} }
#endif /* UNIV_HOTBACKUP */
#ifdef UNIV_LOG_ARCHIVE
/********************************************************** /**********************************************************
Reads from the archive of a log group and performs recovery. */ Reads from the archive of a log group and performs recovery. */
static static
@ -3353,9 +3376,8 @@ void
recv_recovery_from_archive_finish(void) recv_recovery_from_archive_finish(void)
/*===================================*/ /*===================================*/
{ {
ut_a(0);
recv_recovery_from_checkpoint_finish(); recv_recovery_from_checkpoint_finish();
recv_recovery_from_backup_on = FALSE; recv_recovery_from_backup_on = FALSE;
} }
#endif /* UNIV_LOG_ARCHIVE */

View File

@ -33,7 +33,7 @@ struct mem_hash_node_struct {
UT_LIST_NODE_T(mem_hash_node_t) UT_LIST_NODE_T(mem_hash_node_t)
list; /* hash list node */ list; /* hash list node */
mem_heap_t* heap; /* memory heap */ mem_heap_t* heap; /* memory heap */
char* file_name;/* file where heap was created*/ const char* file_name;/* file where heap was created*/
ulint line; /* file line of creation */ ulint line; /* file line of creation */
ulint nth_heap;/* this is the nth heap created */ ulint nth_heap;/* this is the nth heap created */
UT_LIST_NODE_T(mem_hash_node_t) UT_LIST_NODE_T(mem_hash_node_t)
@ -266,7 +266,7 @@ void
mem_hash_insert( mem_hash_insert(
/*============*/ /*============*/
mem_heap_t* heap, /* in: the created heap */ mem_heap_t* heap, /* in: the created heap */
char* file_name, /* in: file name of creation */ const char* file_name, /* in: file name of creation */
ulint line) /* in: line where created */ ulint line) /* in: line where created */
{ {
mem_hash_node_t* new_node; mem_hash_node_t* new_node;
@ -309,7 +309,7 @@ void
mem_hash_remove( mem_hash_remove(
/*============*/ /*============*/
mem_heap_t* heap, /* in: the heap to be freed */ mem_heap_t* heap, /* in: the heap to be freed */
char* file_name, /* in: file name of freeing */ const char* file_name, /* in: file name of freeing */
ulint line) /* in: line where freed */ ulint line) /* in: line where freed */
{ {
mem_hash_node_t* node; mem_hash_node_t* node;

View File

@ -325,7 +325,7 @@ page_create(
tuple = dtuple_create(heap, 1); tuple = dtuple_create(heap, 1);
field = dtuple_get_nth_field(tuple, 0); field = dtuple_get_nth_field(tuple, 0);
dfield_set_data(field,(char *) "infimum", strlen("infimum") + 1); dfield_set_data(field, "infimum", sizeof "infimum");
dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 20, 0); dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 20, 0);
/* Set the corresponding physical record to its place in the page /* Set the corresponding physical record to its place in the page
@ -347,7 +347,7 @@ page_create(
tuple = dtuple_create(heap, 1); tuple = dtuple_create(heap, 1);
field = dtuple_get_nth_field(tuple, 0); field = dtuple_get_nth_field(tuple, 0);
dfield_set_data(field, (char *) "supremum", strlen("supremum") + 1); dfield_set_data(field, "supremum", sizeof "supremum");
dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 20, 0); dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 20, 0);
supremum_rec = rec_convert_dtuple_to_rec(heap_top, tuple); supremum_rec = rec_convert_dtuple_to_rec(heap_top, tuple);

View File

@ -530,7 +530,7 @@ pars_retrieve_table_def(
/*====================*/ /*====================*/
sym_node_t* sym_node) /* in: table node */ sym_node_t* sym_node) /* in: table node */
{ {
char* table_name; const char* table_name;
ut_a(sym_node); ut_a(sym_node);
ut_a(que_node_get_type(sym_node) == QUE_NODE_SYMBOL); ut_a(que_node_get_type(sym_node) == QUE_NODE_SYMBOL);
@ -538,7 +538,7 @@ pars_retrieve_table_def(
sym_node->resolved = TRUE; sym_node->resolved = TRUE;
sym_node->token_type = SYM_TABLE; sym_node->token_type = SYM_TABLE;
table_name = (char*) sym_node->name; table_name = (const char*) sym_node->name;
sym_node->table = dict_table_get_low(table_name); sym_node->table = dict_table_get_low(table_name);

View File

@ -42,13 +42,14 @@ extern
void void
innobase_invalidate_query_cache( innobase_invalidate_query_cache(
/*============================*/ /*============================*/
trx_t* trx, /* in: transaction which modifies the table */ trx_t* trx, /* in: transaction which modifies
char* full_name, /* in: concatenation of database name, null the table */
char '\0', table name, null char'\0'; const char* full_name, /* in: concatenation of database name,
NOTE that in Windows this is always null char '\0', table name, null char
in LOWER CASE! */ '\0'; NOTE that in Windows this is
ulint full_name_len); /* in: full name length where also the null always in LOWER CASE! */
chars count */ ulint full_name_len); /* in: full name length where also the
null chars count */
/************************************************************************* /*************************************************************************
@ -518,7 +519,7 @@ static
void void
row_ins_foreign_report_err( row_ins_foreign_report_err(
/*=======================*/ /*=======================*/
char* errstr, /* in: error string from the viewpoint const char* errstr, /* in: error string from the viewpoint
of the parent table */ of the parent table */
que_thr_t* thr, /* in: query thread whose run_node que_thr_t* thr, /* in: query thread whose run_node
is an update node */ is an update node */
@ -651,25 +652,23 @@ row_ins_foreign_check_on_constraint(
ulint n_to_update; ulint n_to_update;
ulint err; ulint err;
ulint i; ulint i;
char* ptr; const char* ptr;
char table_name_buf[1000]; char* table_name;
ut_a(thr && foreign && pcur && mtr); ut_a(thr && foreign && pcur && mtr);
#ifndef UNIV_HOTBACKUP
/* Since we are going to delete or update a row, we have to invalidate /* Since we are going to delete or update a row, we have to invalidate
the MySQL query cache for table */ the MySQL query cache for table */
ut_a(ut_strlen(table->name) < 998); ptr = strchr(table->name, '/');
strcpy(table_name_buf, table->name);
ptr = strchr(table_name_buf, '/');
ut_a(ptr); ut_a(ptr);
*ptr = '\0'; table_name = mem_strdupl(table->name, ptr - table->name);
/* We call a function in ha_innodb.cc */ /* We call a function in ha_innodb.cc */
#ifndef UNIV_HOTBACKUP innobase_invalidate_query_cache(thr_get_trx(thr), table_name,
innobase_invalidate_query_cache(thr_get_trx(thr), table_name_buf, ptr - table->name + 1);
ut_strlen(table->name) + 1); mem_free(table_name);
#endif #endif
node = thr->run_node; node = thr->run_node;
@ -677,7 +676,7 @@ row_ins_foreign_check_on_constraint(
(DICT_FOREIGN_ON_DELETE_CASCADE (DICT_FOREIGN_ON_DELETE_CASCADE
| DICT_FOREIGN_ON_DELETE_SET_NULL))) { | DICT_FOREIGN_ON_DELETE_SET_NULL))) {
row_ins_foreign_report_err((char*)"Trying to delete", row_ins_foreign_report_err("Trying to delete",
thr, foreign, thr, foreign,
btr_pcur_get_rec(pcur), entry); btr_pcur_get_rec(pcur), entry);
@ -690,7 +689,7 @@ row_ins_foreign_check_on_constraint(
/* This is an UPDATE */ /* This is an UPDATE */
row_ins_foreign_report_err((char*)"Trying to update", row_ins_foreign_report_err("Trying to update",
thr, foreign, thr, foreign,
btr_pcur_get_rec(pcur), entry); btr_pcur_get_rec(pcur), entry);
@ -751,7 +750,7 @@ row_ins_foreign_check_on_constraint(
err = DB_ROW_IS_REFERENCED; err = DB_ROW_IS_REFERENCED;
row_ins_foreign_report_err( row_ins_foreign_report_err(
(char*)"Trying an update, possibly causing a cyclic cascaded update\n" "Trying an update, possibly causing a cyclic cascaded update\n"
"in the child table,", thr, foreign, btr_pcur_get_rec(pcur), entry); "in the child table,", thr, foreign, btr_pcur_get_rec(pcur), entry);
goto nonstandard_exit_func; goto nonstandard_exit_func;
@ -876,7 +875,7 @@ row_ins_foreign_check_on_constraint(
err = DB_ROW_IS_REFERENCED; err = DB_ROW_IS_REFERENCED;
row_ins_foreign_report_err( row_ins_foreign_report_err(
(char*)"Trying a cascaded update where the updated value in the child\n" "Trying a cascaded update where the updated value in the child\n"
"table would not fit in the length of the column, or the value would\n" "table would not fit in the length of the column, or the value would\n"
"be NULL and the column is declared as not NULL in the child table,", "be NULL and the column is declared as not NULL in the child table,",
thr, foreign, btr_pcur_get_rec(pcur), entry); thr, foreign, btr_pcur_get_rec(pcur), entry);
@ -1194,7 +1193,7 @@ run_again:
} }
} else { } else {
row_ins_foreign_report_err( row_ins_foreign_report_err(
(char*)"Trying to delete or update", "Trying to delete or update",
thr, foreign, rec, entry); thr, foreign, rec, entry);
err = DB_ROW_IS_REFERENCED; err = DB_ROW_IS_REFERENCED;

View File

@ -691,7 +691,7 @@ row_lock_table_autoinc_for_mysql(
return(DB_SUCCESS); return(DB_SUCCESS);
} }
trx->op_info = (char *) "setting auto-inc lock"; trx->op_info = "setting auto-inc lock";
if (node == NULL) { if (node == NULL) {
row_get_prebuilt_insert_row(prebuilt); row_get_prebuilt_insert_row(prebuilt);
@ -727,14 +727,14 @@ run_again:
goto run_again; goto run_again;
} }
trx->op_info = (char *) ""; trx->op_info = "";
return(err); return(err);
} }
que_thr_stop_for_mysql_no_error(thr, trx); que_thr_stop_for_mysql_no_error(thr, trx);
trx->op_info = (char *) ""; trx->op_info = "";
return((int) err); return((int) err);
} }
@ -774,7 +774,7 @@ row_lock_table_for_mysql(
ut_ad(trx); ut_ad(trx);
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
trx->op_info = (char *) "setting table lock"; trx->op_info = "setting table lock";
if (prebuilt->sel_graph == NULL) { if (prebuilt->sel_graph == NULL) {
/* Build a dummy select query graph */ /* Build a dummy select query graph */
@ -811,14 +811,14 @@ run_again:
goto run_again; goto run_again;
} }
trx->op_info = (char *) ""; trx->op_info = "";
return(err); return(err);
} }
que_thr_stop_for_mysql_no_error(thr, trx); que_thr_stop_for_mysql_no_error(thr, trx);
trx->op_info = (char *) ""; trx->op_info = "";
return((int) err); return((int) err);
} }
@ -869,7 +869,7 @@ row_insert_for_mysql(
return(DB_ERROR); return(DB_ERROR);
} }
trx->op_info = (char *) "inserting"; trx->op_info = "inserting";
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
@ -910,7 +910,7 @@ run_again:
goto run_again; goto run_again;
} }
trx->op_info = (char *) ""; trx->op_info = "";
return(err); return(err);
} }
@ -927,7 +927,7 @@ run_again:
} }
row_update_statistics_if_needed(prebuilt->table); row_update_statistics_if_needed(prebuilt->table);
trx->op_info = (char *) ""; trx->op_info = "";
return((int) err); return((int) err);
} }
@ -1084,7 +1084,7 @@ row_update_for_mysql(
return(DB_ERROR); return(DB_ERROR);
} }
trx->op_info = (char *) "updating or deleting"; trx->op_info = "updating or deleting";
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
@ -1131,7 +1131,7 @@ run_again:
if (err == DB_RECORD_NOT_FOUND) { if (err == DB_RECORD_NOT_FOUND) {
trx->error_state = DB_SUCCESS; trx->error_state = DB_SUCCESS;
trx->op_info = (char *) ""; trx->op_info = "";
return((int) err); return((int) err);
} }
@ -1142,7 +1142,7 @@ run_again:
goto run_again; goto run_again;
} }
trx->op_info = (char *) ""; trx->op_info = "";
return(err); return(err);
} }
@ -1161,7 +1161,7 @@ run_again:
row_update_statistics_if_needed(prebuilt->table); row_update_statistics_if_needed(prebuilt->table);
trx->op_info = (char *) ""; trx->op_info = "";
return((int) err); return((int) err);
} }
@ -1437,7 +1437,7 @@ row_create_table_for_mysql(
return(DB_ERROR); return(DB_ERROR);
} }
trx->op_info = (char *) "creating table"; trx->op_info = "creating table";
if (row_mysql_is_system_table(table->name)) { if (row_mysql_is_system_table(table->name)) {
@ -1572,7 +1572,7 @@ row_create_table_for_mysql(
que_graph_free((que_t*) que_node_get_parent(thr)); que_graph_free((que_t*) que_node_get_parent(thr));
trx->op_info = (char *) ""; trx->op_info = "";
return((int) err); return((int) err);
} }
@ -1601,7 +1601,7 @@ row_create_index_for_mysql(
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
trx->op_info = (char *) "creating index"; trx->op_info = "creating index";
/* Check that the same column does not appear twice in the index. /* Check that the same column does not appear twice in the index.
Starting from 4.0.14, InnoDB should be able to cope with that, but Starting from 4.0.14, InnoDB should be able to cope with that, but
@ -1669,7 +1669,7 @@ error_handling:
trx->error_state = DB_SUCCESS; trx->error_state = DB_SUCCESS;
} }
trx->op_info = (char *) ""; trx->op_info = "";
return((int) err); return((int) err);
} }
@ -1705,7 +1705,7 @@ row_table_add_foreign_constraints(
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
ut_a(sql_string); ut_a(sql_string);
trx->op_info = (char *) "adding foreign keys"; trx->op_info = "adding foreign keys";
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
@ -1749,8 +1749,8 @@ static
int int
row_drop_table_for_mysql_in_background( row_drop_table_for_mysql_in_background(
/*===================================*/ /*===================================*/
/* out: error code or DB_SUCCESS */ /* out: error code or DB_SUCCESS */
char* name) /* in: table name */ const char* name) /* in: table name */
{ {
ulint error; ulint error;
trx_t* trx; trx_t* trx;
@ -1955,7 +1955,7 @@ row_discard_tablespace_for_mysql(
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
trx->op_info = (char *) "discarding tablespace"; trx->op_info = "discarding tablespace";
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
/* Serialize data dictionary operations with dictionary mutex: /* Serialize data dictionary operations with dictionary mutex:
@ -2060,7 +2060,7 @@ funct_exit:
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);
trx->op_info = (char *) ""; trx->op_info = "";
return((int) err); return((int) err);
} }
@ -2085,7 +2085,7 @@ row_import_tablespace_for_mysql(
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
trx->op_info = (char*) "importing tablespace"; trx->op_info = "importing tablespace";
current_lsn = log_get_lsn(); current_lsn = log_get_lsn();
@ -2165,7 +2165,7 @@ funct_exit:
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);
trx->op_info = (char *) ""; trx->op_info = "";
return((int) err); return((int) err);
} }
@ -2274,7 +2274,7 @@ row_drop_table_for_mysql(
return(DB_ERROR); return(DB_ERROR);
} }
trx->op_info = (char *) "dropping table"; trx->op_info = "dropping table";
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
@ -2507,7 +2507,7 @@ funct_exit:
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);
trx->op_info = (char *) ""; trx->op_info = "";
srv_wake_master_thread(); srv_wake_master_thread();
@ -2533,7 +2533,7 @@ row_drop_database_for_mysql(
ut_a(name != NULL); ut_a(name != NULL);
ut_a(name[namelen - 1] == '/'); ut_a(name[namelen - 1] == '/');
trx->op_info = (char *) "dropping database"; trx->op_info = "dropping database";
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
loop: loop:
@ -2587,7 +2587,7 @@ loop:
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);
trx->op_info = (char *) ""; trx->op_info = "";
return(err); return(err);
} }
@ -2738,7 +2738,7 @@ row_rename_table_for_mysql(
return(DB_ERROR); return(DB_ERROR);
} }
trx->op_info = (char *) "renaming table"; trx->op_info = "renaming table";
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
if (row_mysql_is_recovered_tmp_table(new_name)) { if (row_mysql_is_recovered_tmp_table(new_name)) {
@ -2987,7 +2987,7 @@ funct_exit:
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);
trx->op_info = (char *) ""; trx->op_info = "";
return((int) err); return((int) err);
} }
@ -3125,7 +3125,7 @@ row_check_table_for_mysql(
ulint ret = DB_SUCCESS; ulint ret = DB_SUCCESS;
ulint old_isolation_level; ulint old_isolation_level;
prebuilt->trx->op_info = (char *) "checking table"; prebuilt->trx->op_info = "checking table";
old_isolation_level = prebuilt->trx->isolation_level; old_isolation_level = prebuilt->trx->isolation_level;
@ -3181,7 +3181,7 @@ row_check_table_for_mysql(
ret = DB_ERROR; ret = DB_ERROR;
} }
prebuilt->trx->op_info = (char *) ""; prebuilt->trx->op_info = "";
return(ret); return(ret);
} }

View File

@ -2806,7 +2806,7 @@ row_search_for_mysql(
/* PHASE 1: Try to pop the row from the prefetch cache */ /* PHASE 1: Try to pop the row from the prefetch cache */
if (direction == 0) { if (direction == 0) {
trx->op_info = (char *) "starting index read"; trx->op_info = "starting index read";
prebuilt->n_rows_fetched = 0; prebuilt->n_rows_fetched = 0;
prebuilt->n_fetch_cached = 0; prebuilt->n_fetch_cached = 0;
@ -2817,7 +2817,7 @@ row_search_for_mysql(
row_prebuild_sel_graph(prebuilt); row_prebuild_sel_graph(prebuilt);
} }
} else { } else {
trx->op_info = (char *) "fetching rows"; trx->op_info = "fetching rows";
if (prebuilt->n_rows_fetched == 0) { if (prebuilt->n_rows_fetched == 0) {
prebuilt->fetch_direction = direction; prebuilt->fetch_direction = direction;
@ -2842,7 +2842,7 @@ row_search_for_mysql(
prebuilt->n_rows_fetched++; prebuilt->n_rows_fetched++;
srv_n_rows_read++; srv_n_rows_read++;
trx->op_info = (char *) ""; trx->op_info = "";
return(DB_SUCCESS); return(DB_SUCCESS);
} }
@ -2854,7 +2854,7 @@ row_search_for_mysql(
cache, but the cache was not full at the time of the cache, but the cache was not full at the time of the
popping: no more rows can exist in the result set */ popping: no more rows can exist in the result set */
trx->op_info = (char *) ""; trx->op_info = "";
return(DB_RECORD_NOT_FOUND); return(DB_RECORD_NOT_FOUND);
} }
@ -2899,7 +2899,7 @@ row_search_for_mysql(
if (direction != 0 && !prebuilt->used_in_HANDLER) { if (direction != 0 && !prebuilt->used_in_HANDLER) {
trx->op_info = (char *) ""; trx->op_info = "";
return(DB_RECORD_NOT_FOUND); return(DB_RECORD_NOT_FOUND);
} }
} }
@ -2980,7 +2980,7 @@ row_search_for_mysql(
trx->has_search_latch = FALSE; trx->has_search_latch = FALSE;
} }
trx->op_info = (char *) ""; trx->op_info = "";
/* NOTE that we do NOT store the cursor /* NOTE that we do NOT store the cursor
position */ position */
@ -3003,7 +3003,7 @@ row_search_for_mysql(
trx->has_search_latch = FALSE; trx->has_search_latch = FALSE;
} }
trx->op_info = (char *) ""; trx->op_info = "";
/* NOTE that we do NOT store the cursor /* NOTE that we do NOT store the cursor
position */ position */
@ -3550,7 +3550,7 @@ lock_wait_or_error:
/* fputs("Using ", stderr); /* fputs("Using ", stderr);
dict_index_name_print(stderr, index); dict_index_name_print(stderr, index);
fprintf(stderr, " cnt %lu ret value %lu err\n", cnt, err); */ fprintf(stderr, " cnt %lu ret value %lu err\n", cnt, err); */
trx->op_info = (char *) ""; trx->op_info = "";
return(err); return(err);
@ -3573,7 +3573,7 @@ normal_return:
srv_n_rows_read++; srv_n_rows_read++;
} }
trx->op_info = (char *) ""; trx->op_info = "";
return(ret); return(ret);
} }

View File

@ -57,7 +57,7 @@ ulint srv_activity_count = 0;
ibool srv_lock_timeout_and_monitor_active = FALSE; ibool srv_lock_timeout_and_monitor_active = FALSE;
ibool srv_error_monitor_active = FALSE; ibool srv_error_monitor_active = FALSE;
char* srv_main_thread_op_info = (char*) ""; const char* srv_main_thread_op_info = "";
/* Server parameters which are read from the initfile */ /* Server parameters which are read from the initfile */
@ -65,7 +65,9 @@ char* srv_main_thread_op_info = (char*) "";
names, where the file name itself may also contain a path */ names, where the file name itself may also contain a path */
char* srv_data_home = NULL; char* srv_data_home = NULL;
#ifdef UNIV_LOG_ARCHIVE
char* srv_arch_dir = NULL; char* srv_arch_dir = NULL;
#endif /* UNIV_LOG_ARCHIVE */
ibool srv_file_per_table = FALSE; /* store to its own file each table ibool srv_file_per_table = FALSE; /* store to its own file each table
created by an user; data dictionary created by an user; data dictionary
@ -94,7 +96,6 @@ char** srv_log_group_home_dirs = NULL;
ulint srv_n_log_groups = ULINT_MAX; ulint srv_n_log_groups = ULINT_MAX;
ulint srv_n_log_files = ULINT_MAX; ulint srv_n_log_files = ULINT_MAX;
ulint srv_log_file_size = ULINT_MAX; /* size in database pages */ ulint srv_log_file_size = ULINT_MAX; /* size in database pages */
ibool srv_log_archive_on = FALSE;
ulint srv_log_buffer_size = ULINT_MAX; /* size in database pages */ ulint srv_log_buffer_size = ULINT_MAX; /* size in database pages */
ulint srv_flush_log_at_trx_commit = 1; ulint srv_flush_log_at_trx_commit = 1;
@ -149,8 +150,11 @@ ulint srv_lock_table_size = ULINT_MAX;
ulint srv_n_file_io_threads = ULINT_MAX; ulint srv_n_file_io_threads = ULINT_MAX;
#ifdef UNIV_LOG_ARCHIVE
ibool srv_log_archive_on = FALSE;
ibool srv_archive_recovery = 0; ibool srv_archive_recovery = 0;
dulint srv_archive_recovery_limit_lsn; dulint srv_archive_recovery_limit_lsn;
#endif /* UNIV_LOG_ARCHIVE */
ulint srv_lock_wait_timeout = 1024 * 1024 * 1024; ulint srv_lock_wait_timeout = 1024 * 1024 * 1024;
@ -921,11 +925,11 @@ retry:
os_fast_mutex_unlock(&srv_conc_mutex); os_fast_mutex_unlock(&srv_conc_mutex);
trx->op_info = (char*)"sleeping before joining InnoDB queue"; trx->op_info = "sleeping before joining InnoDB queue";
os_thread_sleep(50000); os_thread_sleep(50000);
trx->op_info = (char*)""; trx->op_info = "";
os_fast_mutex_lock(&srv_conc_mutex); os_fast_mutex_lock(&srv_conc_mutex);
@ -978,11 +982,11 @@ retry:
/* Go to wait for the event; when a thread leaves InnoDB it will /* Go to wait for the event; when a thread leaves InnoDB it will
release this thread */ release this thread */
trx->op_info = (char*)"waiting in InnoDB queue"; trx->op_info = "waiting in InnoDB queue";
os_event_wait(slot->event); os_event_wait(slot->event);
trx->op_info = (char*)""; trx->op_info = "";
os_fast_mutex_lock(&srv_conc_mutex); os_fast_mutex_lock(&srv_conc_mutex);
@ -1946,7 +1950,7 @@ loop:
/* ---- When there is database activity by users, we cycle in this /* ---- When there is database activity by users, we cycle in this
loop */ loop */
srv_main_thread_op_info = (char*) "reserving kernel mutex"; srv_main_thread_op_info = "reserving kernel mutex";
n_ios_very_old = log_sys->n_log_ios + buf_pool->n_pages_read n_ios_very_old = log_sys->n_log_ios + buf_pool->n_pages_read
+ buf_pool->n_pages_written; + buf_pool->n_pages_written;
@ -1970,7 +1974,7 @@ loop:
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
n_ios_old = log_sys->n_log_ios + buf_pool->n_pages_read n_ios_old = log_sys->n_log_ios + buf_pool->n_pages_read
+ buf_pool->n_pages_written; + buf_pool->n_pages_written;
srv_main_thread_op_info = (char*)"sleeping"; srv_main_thread_op_info = "sleeping";
if (!skip_sleep) { if (!skip_sleep) {
@ -1983,12 +1987,11 @@ loop:
can drop tables lazily after there no longer are SELECT can drop tables lazily after there no longer are SELECT
queries to them. */ queries to them. */
srv_main_thread_op_info = srv_main_thread_op_info = "doing background drop tables";
(char*)"doing background drop tables";
row_drop_tables_for_mysql_in_background(); row_drop_tables_for_mysql_in_background();
srv_main_thread_op_info = (char*)""; srv_main_thread_op_info = "";
if (srv_fast_shutdown && srv_shutdown_state > 0) { if (srv_fast_shutdown && srv_shutdown_state > 0) {
@ -1999,10 +2002,10 @@ loop:
is issued or the we have specified in my.cnf no flush is issued or the we have specified in my.cnf no flush
at transaction commit */ at transaction commit */
srv_main_thread_op_info = (char*)"flushing log"; srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk(); log_buffer_flush_to_disk();
srv_main_thread_op_info = (char*)"making checkpoint"; srv_main_thread_op_info = "making checkpoint";
log_free_check(); log_free_check();
/* If there were less than 5 i/os during the /* If there were less than 5 i/os during the
@ -2015,11 +2018,10 @@ loop:
n_ios = log_sys->n_log_ios + buf_pool->n_pages_read n_ios = log_sys->n_log_ios + buf_pool->n_pages_read
+ buf_pool->n_pages_written; + buf_pool->n_pages_written;
if (n_pend_ios < 3 && (n_ios - n_ios_old < 5)) { if (n_pend_ios < 3 && (n_ios - n_ios_old < 5)) {
srv_main_thread_op_info = srv_main_thread_op_info = "doing insert buffer merge";
(char*)"doing insert buffer merge";
ibuf_contract_for_n_pages(TRUE, 5); ibuf_contract_for_n_pages(TRUE, 5);
srv_main_thread_op_info = (char*)"flushing log"; srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk(); log_buffer_flush_to_disk();
} }
@ -2067,20 +2069,20 @@ loop:
+ buf_pool->n_pages_written; + buf_pool->n_pages_written;
if (n_pend_ios < 3 && (n_ios - n_ios_very_old < 200)) { if (n_pend_ios < 3 && (n_ios - n_ios_very_old < 200)) {
srv_main_thread_op_info = (char*) "flushing buffer pool pages"; srv_main_thread_op_info = "flushing buffer pool pages";
buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max); buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max);
srv_main_thread_op_info = (char*) "flushing log"; srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk(); log_buffer_flush_to_disk();
} }
/* We run a batch of insert buffer merge every 10 seconds, /* We run a batch of insert buffer merge every 10 seconds,
even if the server were active */ even if the server were active */
srv_main_thread_op_info = (char*)"doing insert buffer merge"; srv_main_thread_op_info = "doing insert buffer merge";
ibuf_contract_for_n_pages(TRUE, 5); ibuf_contract_for_n_pages(TRUE, 5);
srv_main_thread_op_info = (char*)"flushing log"; srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk(); log_buffer_flush_to_disk();
/* We run a full purge every 10 seconds, even if the server /* We run a full purge every 10 seconds, even if the server
@ -2097,20 +2099,20 @@ loop:
goto background_loop; goto background_loop;
} }
srv_main_thread_op_info = (char*)"purging"; srv_main_thread_op_info = "purging";
n_pages_purged = trx_purge(); n_pages_purged = trx_purge();
current_time = time(NULL); current_time = time(NULL);
if (difftime(current_time, last_flush_time) > 1) { if (difftime(current_time, last_flush_time) > 1) {
srv_main_thread_op_info = (char*) "flushing log"; srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk(); log_buffer_flush_to_disk();
last_flush_time = current_time; last_flush_time = current_time;
} }
} }
srv_main_thread_op_info = (char*)"flushing buffer pool pages"; srv_main_thread_op_info = "flushing buffer pool pages";
/* Flush a few oldest pages to make a new checkpoint younger */ /* Flush a few oldest pages to make a new checkpoint younger */
@ -2131,13 +2133,13 @@ loop:
ut_dulint_max); ut_dulint_max);
} }
srv_main_thread_op_info = (char*)"making checkpoint"; srv_main_thread_op_info = "making checkpoint";
/* Make a new checkpoint about once in 10 seconds */ /* Make a new checkpoint about once in 10 seconds */
log_checkpoint(TRUE, FALSE); log_checkpoint(TRUE, FALSE);
srv_main_thread_op_info = (char*)"reserving kernel mutex"; srv_main_thread_op_info = "reserving kernel mutex";
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
@ -2161,7 +2163,7 @@ background_loop:
/* The server has been quiet for a while: start running background /* The server has been quiet for a while: start running background
operations */ operations */
srv_main_thread_op_info = (char*)"doing background drop tables"; srv_main_thread_op_info = "doing background drop tables";
n_tables_to_drop = row_drop_tables_for_mysql_in_background(); n_tables_to_drop = row_drop_tables_for_mysql_in_background();
@ -2174,7 +2176,7 @@ background_loop:
os_thread_sleep(100000); os_thread_sleep(100000);
} }
srv_main_thread_op_info = (char*)"purging"; srv_main_thread_op_info = "purging";
/* Run a full purge */ /* Run a full purge */
@ -2188,20 +2190,20 @@ background_loop:
break; break;
} }
srv_main_thread_op_info = (char*)"purging"; srv_main_thread_op_info = "purging";
n_pages_purged = trx_purge(); n_pages_purged = trx_purge();
current_time = time(NULL); current_time = time(NULL);
if (difftime(current_time, last_flush_time) > 1) { if (difftime(current_time, last_flush_time) > 1) {
srv_main_thread_op_info = (char*) "flushing log"; srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk(); log_buffer_flush_to_disk();
last_flush_time = current_time; last_flush_time = current_time;
} }
} }
srv_main_thread_op_info = (char*)"reserving kernel mutex"; srv_main_thread_op_info = "reserving kernel mutex";
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
if (srv_activity_count != old_activity_count) { if (srv_activity_count != old_activity_count) {
@ -2210,7 +2212,7 @@ background_loop:
} }
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
srv_main_thread_op_info = (char*)"doing insert buffer merge"; srv_main_thread_op_info = "doing insert buffer merge";
if (srv_fast_shutdown && srv_shutdown_state > 0) { if (srv_fast_shutdown && srv_shutdown_state > 0) {
n_bytes_merged = 0; n_bytes_merged = 0;
@ -2218,7 +2220,7 @@ background_loop:
n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20); n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20);
} }
srv_main_thread_op_info = (char*)"reserving kernel mutex"; srv_main_thread_op_info = "reserving kernel mutex";
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
if (srv_activity_count != old_activity_count) { if (srv_activity_count != old_activity_count) {
@ -2228,10 +2230,10 @@ background_loop:
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
flush_loop: flush_loop:
srv_main_thread_op_info = (char*)"flushing buffer pool pages"; srv_main_thread_op_info = "flushing buffer pool pages";
n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max); n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max);
srv_main_thread_op_info = (char*)"reserving kernel mutex"; srv_main_thread_op_info = "reserving kernel mutex";
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
if (srv_activity_count != old_activity_count) { if (srv_activity_count != old_activity_count) {
@ -2240,15 +2242,14 @@ flush_loop:
} }
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
srv_main_thread_op_info = srv_main_thread_op_info = "waiting for buffer pool flush to end";
(char*) "waiting for buffer pool flush to end";
buf_flush_wait_batch_end(BUF_FLUSH_LIST); buf_flush_wait_batch_end(BUF_FLUSH_LIST);
srv_main_thread_op_info = (char*) "flushing log"; srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk(); log_buffer_flush_to_disk();
srv_main_thread_op_info = (char*)"making checkpoint"; srv_main_thread_op_info = "making checkpoint";
log_checkpoint(TRUE, FALSE); log_checkpoint(TRUE, FALSE);
@ -2260,7 +2261,7 @@ flush_loop:
goto flush_loop; goto flush_loop;
} }
srv_main_thread_op_info = (char*)"reserving kernel mutex"; srv_main_thread_op_info = "reserving kernel mutex";
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
if (srv_activity_count != old_activity_count) { if (srv_activity_count != old_activity_count) {
@ -2269,8 +2270,7 @@ flush_loop:
} }
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
/* /*
srv_main_thread_op_info = srv_main_thread_op_info = "archiving log (if log archive is on)";
(char*)"archiving log (if log archive is on)";
log_archive_do(FALSE, &n_bytes_archived); log_archive_do(FALSE, &n_bytes_archived);
*/ */
@ -2301,7 +2301,7 @@ flush_loop:
master thread to wait for more server activity */ master thread to wait for more server activity */
suspend_thread: suspend_thread:
srv_main_thread_op_info = (char*)"suspending"; srv_main_thread_op_info = "suspending";
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
@ -2315,7 +2315,7 @@ suspend_thread:
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
srv_main_thread_op_info = (char*)"waiting for server activity"; srv_main_thread_op_info = "waiting for server activity";
os_event_wait(event); os_event_wait(event);

View File

@ -628,7 +628,7 @@ open_or_create_log_file(
fil_node_create(name, srv_log_file_size, fil_node_create(name, srv_log_file_size,
2 * k + SRV_LOG_SPACE_FIRST_ID, FALSE); 2 * k + SRV_LOG_SPACE_FIRST_ID, FALSE);
#ifdef notdefined #ifdef UNIV_LOG_ARCHIVE
/* If this is the first log group, create the file space object /* If this is the first log group, create the file space object
for archived logs. for archived logs.
Under MySQL, no archiving ever done. */ Under MySQL, no archiving ever done. */
@ -636,12 +636,11 @@ open_or_create_log_file(
if (k == 0 && i == 0) { if (k == 0 && i == 0) {
arch_space_id = 2 * k + 1 + SRV_LOG_SPACE_FIRST_ID; arch_space_id = 2 * k + 1 + SRV_LOG_SPACE_FIRST_ID;
fil_space_create((char*) "arch_log_space", arch_space_id, fil_space_create("arch_log_space", arch_space_id, FIL_LOG);
FIL_LOG);
} else { } else {
arch_space_id = ULINT_UNDEFINED; arch_space_id = ULINT_UNDEFINED;
} }
#endif #endif /* UNIV_LOG_ARCHIVE */
if (i == 0) { if (i == 0) {
log_group_init(k, srv_n_log_files, log_group_init(k, srv_n_log_files,
srv_log_file_size * UNIV_PAGE_SIZE, srv_log_file_size * UNIV_PAGE_SIZE,
@ -662,12 +661,14 @@ open_or_create_data_files(
/* out: DB_SUCCESS or error code */ /* out: DB_SUCCESS or error code */
ibool* create_new_db, /* out: TRUE if new database should be ibool* create_new_db, /* out: TRUE if new database should be
created */ created */
dulint* min_flushed_lsn,/* out: min of flushed lsn values in data #ifdef UNIV_LOG_ARCHIVE
files */
ulint* min_arch_log_no,/* out: min of archived log numbers in data ulint* min_arch_log_no,/* out: min of archived log numbers in data
files */ files */
dulint* max_flushed_lsn,/* out: */
ulint* max_arch_log_no,/* out: */ ulint* max_arch_log_no,/* out: */
#endif /* UNIV_LOG_ARCHIVE */
dulint* min_flushed_lsn,/* out: min of flushed lsn values in data
files */
dulint* max_flushed_lsn,/* out: */
ulint* sum_of_new_sizes)/* out: sum of sizes of the new files added */ ulint* sum_of_new_sizes)/* out: sum of sizes of the new files added */
{ {
ibool ret; ibool ret;
@ -820,8 +821,10 @@ open_or_create_data_files(
skip_size_check: skip_size_check:
fil_read_flushed_lsn_and_arch_log_no(files[i], fil_read_flushed_lsn_and_arch_log_no(files[i],
one_opened, one_opened,
min_flushed_lsn, min_arch_log_no, #ifdef UNIV_LOG_ARCHIVE
max_flushed_lsn, max_arch_log_no); min_arch_log_no, max_arch_log_no,
#endif /* UNIV_LOG_ARCHIVE */
min_flushed_lsn, max_flushed_lsn);
one_opened = TRUE; one_opened = TRUE;
} else { } else {
/* We created the data file and now write it full of /* We created the data file and now write it full of
@ -908,8 +911,10 @@ innobase_start_or_create_for_mysql(void)
ibool log_opened = FALSE; ibool log_opened = FALSE;
dulint min_flushed_lsn; dulint min_flushed_lsn;
dulint max_flushed_lsn; dulint max_flushed_lsn;
#ifdef UNIV_LOG_ARCHIVE
ulint min_arch_log_no; ulint min_arch_log_no;
ulint max_arch_log_no; ulint max_arch_log_no;
#endif /* UNIV_LOG_ARCHIVE */
ulint sum_of_new_sizes; ulint sum_of_new_sizes;
ulint sum_of_data_file_sizes; ulint sum_of_data_file_sizes;
ulint tablespace_size_in_header; ulint tablespace_size_in_header;
@ -1017,28 +1022,22 @@ innobase_start_or_create_for_mysql(void)
srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED; srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
#ifndef __WIN__ #ifndef __WIN__
} else if (0 == ut_strcmp(srv_file_flush_method_str, } else if (0 == ut_strcmp(srv_file_flush_method_str, "fdatasync")) {
(char*)"fdatasync")) {
srv_unix_file_flush_method = SRV_UNIX_FDATASYNC; srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
} else if (0 == ut_strcmp(srv_file_flush_method_str, } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DSYNC")) {
(char*)"O_DSYNC")) {
srv_unix_file_flush_method = SRV_UNIX_O_DSYNC; srv_unix_file_flush_method = SRV_UNIX_O_DSYNC;
} else if (0 == ut_strcmp(srv_file_flush_method_str, } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT")) {
(char*)"O_DIRECT")) {
srv_unix_file_flush_method = SRV_UNIX_O_DIRECT; srv_unix_file_flush_method = SRV_UNIX_O_DIRECT;
} else if (0 == ut_strcmp(srv_file_flush_method_str, } else if (0 == ut_strcmp(srv_file_flush_method_str, "littlesync")) {
(char*)"littlesync")) {
srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC; srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;
} else if (0 == ut_strcmp(srv_file_flush_method_str, } else if (0 == ut_strcmp(srv_file_flush_method_str, "nosync")) {
(char*)"nosync")) {
srv_unix_file_flush_method = SRV_UNIX_NOSYNC; srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
#else #else
} else if (0 == ut_strcmp(srv_file_flush_method_str, } else if (0 == ut_strcmp(srv_file_flush_method_str, "normal")) {
(char*)"normal")) {
srv_win_file_flush_method = SRV_WIN_IO_NORMAL; srv_win_file_flush_method = SRV_WIN_IO_NORMAL;
os_aio_use_native_aio = FALSE; os_aio_use_native_aio = FALSE;
@ -1181,6 +1180,7 @@ NetWare. */
os_thread_create(io_handler_thread, n + i, thread_ids + i); os_thread_create(io_handler_thread, n + i, thread_ids + i);
} }
#ifdef UNIV_LOG_ARCHIVE
if (0 != ut_strcmp(srv_log_group_home_dirs[0], srv_arch_dir)) { if (0 != ut_strcmp(srv_log_group_home_dirs[0], srv_arch_dir)) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: you must set the log group home dir in my.cnf the\n" "InnoDB: Error: you must set the log group home dir in my.cnf the\n"
@ -1188,6 +1188,7 @@ NetWare. */
return(DB_ERROR); return(DB_ERROR);
} }
#endif /* UNIV_LOG_ARCHIVE */
if (srv_n_log_files * srv_log_file_size >= 262144) { if (srv_n_log_files * srv_log_file_size >= 262144) {
fprintf(stderr, fprintf(stderr,
@ -1219,8 +1220,10 @@ NetWare. */
} }
err = open_or_create_data_files(&create_new_db, err = open_or_create_data_files(&create_new_db,
&min_flushed_lsn, &min_arch_log_no, #ifdef UNIV_LOG_ARCHIVE
&max_flushed_lsn, &max_arch_log_no, &min_arch_log_no, &max_arch_log_no,
#endif /* UNIV_LOG_ARCHIVE */
&min_flushed_lsn, &max_flushed_lsn,
&sum_of_new_sizes); &sum_of_new_sizes);
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
fprintf(stderr, fprintf(stderr,
@ -1235,8 +1238,10 @@ NetWare. */
return((int) err); return((int) err);
} }
#ifdef UNIV_LOG_ARCHIVE
srv_normalize_path_for_win(srv_arch_dir); srv_normalize_path_for_win(srv_arch_dir);
srv_arch_dir = srv_add_path_separator_if_needed(srv_arch_dir); srv_arch_dir = srv_add_path_separator_if_needed(srv_arch_dir);
#endif /* UNIV_LOG_ARCHIVE */
for (i = 0; i < srv_n_log_files; i++) { for (i = 0; i < srv_n_log_files; i++) {
err = open_or_create_log_file(create_new_db, &log_file_created, err = open_or_create_log_file(create_new_db, &log_file_created,
@ -1270,9 +1275,16 @@ NetWare. */
fil_open_log_and_system_tablespace_files(); fil_open_log_and_system_tablespace_files();
if (log_created && !create_new_db && !srv_archive_recovery) { if (log_created && !create_new_db
#ifdef UNIV_LOG_ARCHIVE
&& !srv_archive_recovery
#endif /* UNIV_LOG_ARCHIVE */
) {
if (ut_dulint_cmp(max_flushed_lsn, min_flushed_lsn) != 0 if (ut_dulint_cmp(max_flushed_lsn, min_flushed_lsn) != 0
|| max_arch_log_no != min_arch_log_no) { #ifdef UNIV_LOG_ARCHIVE
|| max_arch_log_no != min_arch_log_no
#endif /* UNIV_LOG_ARCHIVE */
) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Cannot initialize created log files because\n" "InnoDB: Cannot initialize created log files because\n"
"InnoDB: data files were not in sync with each other\n" "InnoDB: data files were not in sync with each other\n"
@ -1295,10 +1307,14 @@ NetWare. */
mutex_enter(&(log_sys->mutex)); mutex_enter(&(log_sys->mutex));
#ifdef UNIV_LOG_ARCHIVE
/* Do not + 1 arch_log_no because we do not use log /* Do not + 1 arch_log_no because we do not use log
archiving */ archiving */
recv_reset_logs(max_flushed_lsn, max_arch_log_no, TRUE); recv_reset_logs(max_flushed_lsn, max_arch_log_no, TRUE);
#else
recv_reset_logs(max_flushed_lsn, TRUE);
#endif /* UNIV_LOG_ARCHIVE */
mutex_exit(&(log_sys->mutex)); mutex_exit(&(log_sys->mutex));
} }
@ -1313,6 +1329,7 @@ NetWare. */
dict_create(); dict_create();
srv_startup_is_before_trx_rollback_phase = FALSE; srv_startup_is_before_trx_rollback_phase = FALSE;
#ifdef UNIV_LOG_ARCHIVE
} else if (srv_archive_recovery) { } else if (srv_archive_recovery) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Starting archive recovery from a backup...\n"); "InnoDB: Starting archive recovery from a backup...\n");
@ -1336,6 +1353,7 @@ NetWare. */
fsp_header_get_free_limit(0); fsp_header_get_free_limit(0);
recv_recovery_from_archive_finish(); recv_recovery_from_archive_finish();
#endif /* UNIV_LOG_ARCHIVE */
} else { } else {
/* We always try to do a recovery, even if the database had /* We always try to do a recovery, even if the database had
been shut down normally: this is the normal startup path */ been shut down normally: this is the normal startup path */
@ -1384,7 +1402,7 @@ NetWare. */
log_make_checkpoint_at(ut_dulint_max, TRUE); log_make_checkpoint_at(ut_dulint_max, TRUE);
#ifdef notdefined #ifdef UNIV_LOG_ARCHIVE
/* Archiving is always off under MySQL */ /* Archiving is always off under MySQL */
if (!srv_log_archive_on) { if (!srv_log_archive_on) {
ut_a(DB_SUCCESS == log_archive_noarchivelog()); ut_a(DB_SUCCESS == log_archive_noarchivelog());
@ -1403,7 +1421,7 @@ NetWare. */
ut_a(DB_SUCCESS == log_archive_archivelog()); ut_a(DB_SUCCESS == log_archive_archivelog());
} }
} }
#endif #endif /* UNIV_LOG_ARCHIVE */
if (!create_new_db && srv_force_recovery == 0) { if (!create_new_db && srv_force_recovery == 0) {
/* After a crash recovery we only check that the info in data /* After a crash recovery we only check that the info in data
dictionary is consistent with what we already know about space dictionary is consistent with what we already know about space

View File

@ -119,8 +119,8 @@ rw_lock_create_func(
lock->cfile_name = cfile_name; lock->cfile_name = cfile_name;
lock->cline = cline; lock->cline = cline;
lock->last_s_file_name = (char *) "not yet reserved"; lock->last_s_file_name = "not yet reserved";
lock->last_x_file_name = (char *) "not yet reserved"; lock->last_x_file_name = "not yet reserved";
lock->last_s_line = 0; lock->last_s_line = 0;
lock->last_x_line = 0; lock->last_x_line = 0;
@ -593,7 +593,7 @@ rw_lock_add_debug_info(
rw_lock_t* lock, /* in: rw-lock */ rw_lock_t* lock, /* in: rw-lock */
ulint pass, /* in: pass value */ ulint pass, /* in: pass value */
ulint lock_type, /* in: lock type */ ulint lock_type, /* in: lock type */
char* file_name, /* in: file where requested */ const char* file_name, /* in: file where requested */
ulint line) /* in: line where requested */ ulint line) /* in: line where requested */
{ {
rw_lock_debug_t* info; rw_lock_debug_t* info;

View File

@ -214,7 +214,7 @@ mutex_create_func(
mutex->magic_n = MUTEX_MAGIC_N; mutex->magic_n = MUTEX_MAGIC_N;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
mutex->line = 0; mutex->line = 0;
mutex->file_name = (char *) "not yet reserved"; mutex->file_name = "not yet reserved";
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
mutex->level = SYNC_LEVEL_NONE; mutex->level = SYNC_LEVEL_NONE;
mutex->cfile_name = cfile_name; mutex->cfile_name = cfile_name;
@ -512,7 +512,7 @@ void
mutex_set_debug_info( mutex_set_debug_info(
/*=================*/ /*=================*/
mutex_t* mutex, /* in: mutex */ mutex_t* mutex, /* in: mutex */
char* file_name, /* in: file where requested */ const char* file_name, /* in: file where requested */
ulint line) /* in: line where requested */ ulint line) /* in: line where requested */
{ {
ut_ad(mutex); ut_ad(mutex);

View File

@ -116,11 +116,11 @@ trx_rollback_for_mysql(
return(DB_SUCCESS); return(DB_SUCCESS);
} }
trx->op_info = (char *) "rollback"; trx->op_info = "rollback";
err = trx_general_rollback_for_mysql(trx, FALSE, NULL); err = trx_general_rollback_for_mysql(trx, FALSE, NULL);
trx->op_info = (char *) ""; trx->op_info = "";
return(err); return(err);
} }
@ -141,14 +141,14 @@ trx_rollback_last_sql_stat_for_mysql(
return(DB_SUCCESS); return(DB_SUCCESS);
} }
trx->op_info = (char *) "rollback of SQL statement"; trx->op_info = "rollback of SQL statement";
err = trx_general_rollback_for_mysql(trx, TRUE, err = trx_general_rollback_for_mysql(trx, TRUE,
&(trx->last_sql_stat_start)); &(trx->last_sql_stat_start));
/* The following call should not be needed, but we play safe: */ /* The following call should not be needed, but we play safe: */
trx_mark_sql_stat_end(trx); trx_mark_sql_stat_end(trx);
trx->op_info = (char *) ""; trx->op_info = "";
return(err); return(err);
} }
@ -239,7 +239,7 @@ trx_rollback_to_savepoint_for_mysql(
*mysql_binlog_cache_pos = savep->mysql_binlog_cache_pos; *mysql_binlog_cache_pos = savep->mysql_binlog_cache_pos;
trx->op_info = (char *) "rollback to a savepoint"; trx->op_info = "rollback to a savepoint";
err = trx_general_rollback_for_mysql(trx, TRUE, &(savep->savept)); err = trx_general_rollback_for_mysql(trx, TRUE, &(savep->savept));
@ -248,7 +248,7 @@ trx_rollback_to_savepoint_for_mysql(
trx_mark_sql_stat_end(trx); trx_mark_sql_stat_end(trx);
trx->op_info = (char *) ""; trx->op_info = "";
return(err); return(err);
} }
@ -343,7 +343,7 @@ trx_rollback_or_clean_all_without_sess(void)
trx_t* trx; trx_t* trx;
dict_table_t* table; dict_table_t* table;
ib_longlong rows_to_undo; ib_longlong rows_to_undo;
char* unit = (char*)""; const char* unit = "";
int err; int err;
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
@ -421,7 +421,7 @@ loop:
rows_to_undo = trx_roll_max_undo_no; rows_to_undo = trx_roll_max_undo_no;
if (rows_to_undo > 1000000000) { if (rows_to_undo > 1000000000) {
rows_to_undo = rows_to_undo / 1000000; rows_to_undo = rows_to_undo / 1000000;
unit = (char*)"M"; unit = "M";
} }
fprintf(stderr, fprintf(stderr,

View File

@ -832,7 +832,7 @@ trx_sys_init_at_db_start(void)
{ {
trx_sysf_t* sys_header; trx_sysf_t* sys_header;
ib_longlong rows_to_undo = 0; ib_longlong rows_to_undo = 0;
char* unit = (char*)""; const char* unit = "";
trx_t* trx; trx_t* trx;
mtr_t mtr; mtr_t mtr;
@ -881,7 +881,7 @@ trx_sys_init_at_db_start(void)
} }
if (rows_to_undo > 1000000000) { if (rows_to_undo > 1000000000) {
unit = (char*)"M"; unit = "M";
rows_to_undo = rows_to_undo / 1000000; rows_to_undo = rows_to_undo / 1000000;
} }

View File

@ -81,7 +81,7 @@ trx_create(
trx->magic_n = TRX_MAGIC_N; trx->magic_n = TRX_MAGIC_N;
trx->op_info = (char *) ""; trx->op_info = "";
trx->type = TRX_USER; trx->type = TRX_USER;
trx->conc_state = TRX_NOT_STARTED; trx->conc_state = TRX_NOT_STARTED;
@ -107,7 +107,7 @@ trx_create(
trx->mysql_log_file_name = NULL; trx->mysql_log_file_name = NULL;
trx->mysql_log_offset = 0; trx->mysql_log_offset = 0;
trx->mysql_master_log_file_name = (char*)""; trx->mysql_master_log_file_name = "";
trx->mysql_master_log_pos = 0; trx->mysql_master_log_pos = 0;
mutex_create(&(trx->undo_mutex)); mutex_create(&(trx->undo_mutex));
@ -1394,7 +1394,7 @@ trx_commit_for_mysql(
ut_a(trx); ut_a(trx);
trx->op_info = (char *) "committing"; trx->op_info = "committing";
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
@ -1404,7 +1404,7 @@ trx_commit_for_mysql(
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
trx->op_info = (char *) ""; trx->op_info = "";
return(0); return(0);
} }
@ -1423,7 +1423,7 @@ trx_commit_complete_for_mysql(
ut_a(trx); ut_a(trx);
trx->op_info = (char*)"flushing log"; trx->op_info = "flushing log";
if (srv_flush_log_at_trx_commit == 0) { if (srv_flush_log_at_trx_commit == 0) {
/* Do nothing */ /* Do nothing */
@ -1447,7 +1447,7 @@ trx_commit_complete_for_mysql(
ut_error; ut_error;
} }
trx->op_info = (char*)""; trx->op_info = "";
return(0); return(0);
} }

View File

@ -103,7 +103,7 @@ are determined in innobase_init below: */
char* innobase_data_home_dir = NULL; char* innobase_data_home_dir = NULL;
char* innobase_data_file_path = NULL; char* innobase_data_file_path = NULL;
char* innobase_log_group_home_dir = NULL; char* innobase_log_group_home_dir = NULL;
char* innobase_log_arch_dir = NULL; char* innobase_log_arch_dir = NULL;/* unused */
/* The following has a misleading name: starting from 4.0.5, this also /* The following has a misleading name: starting from 4.0.5, this also
affects Windows: */ affects Windows: */
char* innobase_unix_file_flush_method = NULL; char* innobase_unix_file_flush_method = NULL;
@ -112,7 +112,7 @@ char* innobase_unix_file_flush_method = NULL;
values */ values */
uint innobase_flush_log_at_trx_commit = 1; uint innobase_flush_log_at_trx_commit = 1;
my_bool innobase_log_archive = FALSE; my_bool innobase_log_archive = FALSE;/* unused */
my_bool innobase_use_native_aio = FALSE; my_bool innobase_use_native_aio = FALSE;
my_bool innobase_fast_shutdown = TRUE; my_bool innobase_fast_shutdown = TRUE;
my_bool innobase_file_per_table = FALSE; my_bool innobase_file_per_table = FALSE;
@ -839,7 +839,8 @@ innobase_init(void)
if (!innobase_log_group_home_dir) { if (!innobase_log_group_home_dir) {
innobase_log_group_home_dir = default_path; innobase_log_group_home_dir = default_path;
} }
#ifdef UNIV_LOG_ARCHIVE
/* Since innodb_log_arch_dir has no relevance under MySQL, /* Since innodb_log_arch_dir has no relevance under MySQL,
starting from 4.0.6 we always set it the same as starting from 4.0.6 we always set it the same as
innodb_log_group_home_dir: */ innodb_log_group_home_dir: */
@ -847,6 +848,7 @@ innobase_init(void)
innobase_log_arch_dir = innobase_log_group_home_dir; innobase_log_arch_dir = innobase_log_group_home_dir;
srv_arch_dir = innobase_log_arch_dir; srv_arch_dir = innobase_log_arch_dir;
#endif /* UNIG_LOG_ARCHIVE */
ret = (bool) ret = (bool)
srv_parse_log_group_home_dirs(innobase_log_group_home_dir, srv_parse_log_group_home_dirs(innobase_log_group_home_dir,
@ -868,7 +870,9 @@ innobase_init(void)
srv_n_log_files = (ulint) innobase_log_files_in_group; srv_n_log_files = (ulint) innobase_log_files_in_group;
srv_log_file_size = (ulint) innobase_log_file_size; srv_log_file_size = (ulint) innobase_log_file_size;
#ifdef UNIV_LOG_ARCHIVE
srv_log_archive_on = (ulint) innobase_log_archive; srv_log_archive_on = (ulint) innobase_log_archive;
#endif /* UNIV_LOG_ARCHIVE */
srv_log_buffer_size = (ulint) innobase_log_buffer_size; srv_log_buffer_size = (ulint) innobase_log_buffer_size;
srv_flush_log_at_trx_commit = (ulint) innobase_flush_log_at_trx_commit; srv_flush_log_at_trx_commit = (ulint) innobase_flush_log_at_trx_commit;