summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-05-27 15:27:43 +0300
committerunknown <marko@hundin.mysql.fi>2004-05-27 15:27:43 +0300
commita1bcf38257fcb124b1ed8432137d82aed95da32d (patch)
tree566268309e7e64b4e2f6a23700e7b8623521cbbd /innobase
parentd366a2e4c97155d5ea10a7da084d188d7e42222c (diff)
downloadmariadb-git-a1bcf38257fcb124b1ed8432137d82aed95da32d.tar.gz
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 innobase/btr/btr0cur.c: Cast away constness from dfield_get_data() result innobase/buf/buf0buf.c: Enclose a debug assertion in #ifdef UNIV_SYNC_DEBUG innobase/buf/buf0rea.c: Corrected compile error #ifdef UNIV_DEBUG innobase/dict/dict0boot.c: Remove (char*) casts of string constants innobase/dict/dict0crea.c: Remove (char*) casts of string constants innobase/dict/dict0dict.c: Enclosed a debug assertion in #ifdef UNIV_SYNC_DEBUG Replaced some debug assertions with preprocessor tests Add const qualifiers to string constants innobase/dict/dict0load.c: Remove (char*) casts of string constants innobase/fil/fil0fil.c: Remove (char*) casts of string constants Enclose debug assertions in #ifdef UNIV_SYNC_DEBUG innobase/ha/ha0ha.c: Enclose debug assertion in #ifdef UNIV_SYNC_DEBUG innobase/ibuf/ibuf0ibuf.c: Remove (char*) casts of string constants innobase/include/buf0buf.ic: Add const qualifier to string parameter innobase/include/fil0fil.h: Disable log archiving code unless #ifdef UNIV_LOG_ARCHIVE innobase/include/log0recv.h: Disable log archiving code unless #ifdef UNIV_LOG_ARCHIVE Enclose ibbackup specific code in #ifdef UNIV_HOTBACKUP innobase/include/mem0dbg.ic: Add const qualifiers to string parameters innobase/include/srv0srv.h: Add const qualifiers to string constants Enclose srv_arch_dir and srv_log_archive_on #ifdef UNIV_LOG_ARCHIVE innobase/include/sync0rw.ic: Add const qualifier to string parameter innobase/include/sync0sync.ic: Add const qualifier to string parameter innobase/log/log0log.c: Enclose log archiving code in #ifdef UNIV_LOG_ARCHIVE Do not cast string constants to (char*) innobase/log/log0recv.c: Enclose ibbackup specific code in #ifdef UNIV_HOTBACKUP Enclose disabled log code in #ifdef UNIV_LOG_REPLICATE or UNIV_LOG_ARCHIVE innobase/mem/mem0dbg.c: Add const qualifiers to string parameters innobase/page/page0page.c: Remove (char*) casts of string constants innobase/pars/pars0pars.c: Add const qualifier to string variable innobase/row/row0ins.c: Remove (char*) casts of string constants Add const qualifiers to string parameters row_ins_foreign_check_on_constraint(): Allocate table_name dynamically innobase/row/row0mysql.c: Remove (char*) casts of string constants innobase/row/row0sel.c: Remove (char*) casts of string constants innobase/srv/srv0srv.c: Remove (char*) casts of string constants Disable log archiving variables unless #ifdef UNIV_LOG_ARCHIVE innobase/srv/srv0start.c: Disable log archiving code unless #ifdef UNIV_LOG_ARCHIVE Remove (char*) casts of string constants innobase/sync/sync0rw.c: Remove (char*) casts of string constants Add const qualifier to string parameter innobase/sync/sync0sync.c: Remove (char*) cast of string constant Add const qualifier to string parameter innobase/trx/trx0roll.c: Remove (char*) cast of string constants innobase/trx/trx0sys.c: Remove (char*) cast of string constants innobase/trx/trx0trx.c: Remove (char*) cast of string constant sql/ha_innodb.cc: Enclose log archiving code in #ifdef UNIV_LOG_ARCHIVE
Diffstat (limited to 'innobase')
-rw-r--r--innobase/btr/btr0cur.c4
-rw-r--r--innobase/buf/buf0buf.c2
-rw-r--r--innobase/buf/buf0rea.c2
-rw-r--r--innobase/dict/dict0boot.c105
-rw-r--r--innobase/dict/dict0crea.c22
-rw-r--r--innobase/dict/dict0dict.c55
-rw-r--r--innobase/dict/dict0load.c46
-rw-r--r--innobase/fil/fil0fil.c100
-rw-r--r--innobase/ha/ha0ha.c2
-rw-r--r--innobase/ibuf/ibuf0ibuf.c10
-rw-r--r--innobase/include/buf0buf.ic2
-rw-r--r--innobase/include/fil0fil.h8
-rw-r--r--innobase/include/log0recv.h19
-rw-r--r--innobase/include/mem0dbg.ic4
-rw-r--r--innobase/include/srv0srv.h11
-rw-r--r--innobase/include/sync0rw.ic2
-rw-r--r--innobase/include/sync0sync.ic2
-rw-r--r--innobase/log/log0log.c129
-rw-r--r--innobase/log/log0recv.c70
-rw-r--r--innobase/mem/mem0dbg.c6
-rw-r--r--innobase/page/page0page.c4
-rw-r--r--innobase/pars/pars0pars.c4
-rw-r--r--innobase/row/row0ins.c45
-rw-r--r--innobase/row/row0mysql.c64
-rw-r--r--innobase/row/row0sel.c18
-rw-r--r--innobase/srv/srv0srv.c86
-rw-r--r--innobase/srv/srv0start.c74
-rw-r--r--innobase/sync/sync0rw.c6
-rw-r--r--innobase/sync/sync0sync.c4
-rw-r--r--innobase/trx/trx0roll.c16
-rw-r--r--innobase/trx/trx0sys.c4
-rw-r--r--innobase/trx/trx0trx.c12
32 files changed, 509 insertions, 429 deletions
diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c
index 5829cc2c406..2e9194ff30f 100644
--- a/innobase/btr/btr0cur.c
+++ b/innobase/btr/btr0cur.c
@@ -2937,7 +2937,7 @@ btr_cur_mark_dtuple_inherited_extern(
if (!is_updated) {
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 -= BTR_EXTERN_FIELD_REF_SIZE;
@@ -2997,7 +2997,7 @@ btr_cur_unmark_dtuple_extern_fields(
for (i = 0; i < n_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 -= BTR_EXTERN_FIELD_REF_SIZE;
diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c
index 4d83fb4c9f2..268d6f8e16d 100644
--- a/innobase/buf/buf0buf.c
+++ b/innobase/buf/buf0buf.c
@@ -719,7 +719,9 @@ buf_awe_map_page_to_frame(
{
buf_block_t* bck;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(block);
if (block->frame) {
diff --git a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c
index e0f8291977e..63e078f3f6e 100644
--- a/innobase/buf/buf0rea.c
+++ b/innobase/buf/buf0rea.c
@@ -640,7 +640,7 @@ buf_read_ibuf_merge_pages(
if (buf_debug_prints) {
fprintf(stderr,
"Ibuf merge read-ahead space %lu pages %lu\n",
- (ulong) space, (ulong) n_stored);
+ (ulong) space_ids[0], (ulong) n_stored);
}
#endif /* UNIV_DEBUG */
}
diff --git a/innobase/dict/dict0boot.c b/innobase/dict/dict0boot.c
index 8e1629819f3..f156cf67a18 100644
--- a/innobase/dict/dict0boot.c
+++ b/innobase/dict/dict0boot.c
@@ -254,29 +254,26 @@ dict_boot(void)
/* Insert into the dictionary cache the descriptions of the basic
system tables */
/*-------------------------*/
- table = dict_mem_table_create((char *) "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, (char *) "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, (char *) "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, (char *) "MIX_LEN", DATA_INT, 0, 4, 0);
- dict_mem_table_add_col(table, (char *) "CLUSTER_NAME", DATA_BINARY,
- 0, 0, 0);
- dict_mem_table_add_col(table, (char *) "SPACE", DATA_INT, 0, 4, 0);
+ table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE,8);
+
+ dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
+ dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0, 0);
+ dict_mem_table_add_col(table, "N_COLS", DATA_INT, 0, 4, 0);
+ dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4, 0);
+ dict_mem_table_add_col(table, "MIX_ID", DATA_BINARY, 0, 0, 0);
+ dict_mem_table_add_col(table, "MIX_LEN", DATA_INT, 0, 4, 0);
+ dict_mem_table_add_col(table, "CLUSTER_NAME", DATA_BINARY, 0, 0, 0);
+ dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4, 0);
table->id = DICT_TABLES_ID;
dict_table_add_to_cache(table);
dict_sys->sys_tables = table;
- index = dict_mem_index_create((char *) "SYS_TABLES", (char *)
- "CLUST_IND",
- DICT_HDR_SPACE,
- DICT_UNIQUE | DICT_CLUSTERED, 1);
+ index = dict_mem_index_create("SYS_TABLES", "CLUST_IND",
+ 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,
MLOG_4BYTES, &mtr);
@@ -284,52 +281,50 @@ dict_boot(void)
ut_a(dict_index_add_to_cache(table, index));
/*-------------------------*/
- index = dict_mem_index_create((char *) "SYS_TABLES",
- (char *) "ID_IND", DICT_HDR_SPACE,
- DICT_UNIQUE, 1);
- dict_mem_index_add_field(index, (char *) "ID", 0, 0);
+ index = dict_mem_index_create("SYS_TABLES", "ID_IND",
+ DICT_HDR_SPACE, DICT_UNIQUE, 1);
+ dict_mem_index_add_field(index, "ID", 0, 0);
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLE_IDS,
MLOG_4BYTES, &mtr);
index->id = DICT_TABLE_IDS_ID;
ut_a(dict_index_add_to_cache(table, index));
/*-------------------------*/
- table = dict_mem_table_create((char *) "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, (char *) "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, (char *) "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, (char *) "LEN", DATA_INT, 0, 4, 0);
- dict_mem_table_add_col(table, (char *) "PREC", DATA_INT, 0, 4, 0);
+ table = dict_mem_table_create("SYS_COLUMNS",DICT_HDR_SPACE,7);
+
+ dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY,0,0,0);
+ dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0);
+ dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
+ dict_mem_table_add_col(table, "MTYPE", DATA_INT, 0, 4, 0);
+ dict_mem_table_add_col(table, "PRTYPE", DATA_INT, 0, 4, 0);
+ dict_mem_table_add_col(table, "LEN", DATA_INT, 0, 4, 0);
+ dict_mem_table_add_col(table, "PREC", DATA_INT, 0, 4, 0);
table->id = DICT_COLUMNS_ID;
dict_table_add_to_cache(table);
dict_sys->sys_columns = table;
- index = dict_mem_index_create((char *) "SYS_COLUMNS",
- (char *) "CLUST_IND", DICT_HDR_SPACE,
- DICT_UNIQUE | DICT_CLUSTERED, 2);
+ index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND",
+ DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
- dict_mem_index_add_field(index, (char *) "TABLE_ID", 0, 0);
- dict_mem_index_add_field(index, (char *) "POS", 0, 0);
+ dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
+ dict_mem_index_add_field(index, "POS", 0, 0);
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_COLUMNS,
MLOG_4BYTES, &mtr);
index->id = DICT_COLUMNS_ID;
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, (char *) "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, (char *) "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, (char *) "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, "TABLE_ID", DATA_BINARY, 0,0,0);
+ dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0, 0);
+ dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0, 0);
+ dict_mem_table_add_col(table, "N_FIELDS", DATA_INT, 0, 4, 0);
+ dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4, 0);
+ dict_mem_table_add_col(table, "SPACE", 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 */
#if DICT_SYS_INDEXES_PAGE_NO_FIELD != 6 + 2
@@ -343,34 +338,32 @@ dict_boot(void)
dict_table_add_to_cache(table);
dict_sys->sys_indexes = table;
- index = dict_mem_index_create((char *) "SYS_INDEXES",
- (char *) "CLUST_IND", DICT_HDR_SPACE,
- DICT_UNIQUE | DICT_CLUSTERED, 2);
+ index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND",
+ DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
- dict_mem_index_add_field(index, (char *) "TABLE_ID", 0, 0);
- dict_mem_index_add_field(index, (char *) "ID", 0, 0);
+ dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
+ dict_mem_index_add_field(index, "ID", 0, 0);
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_INDEXES,
MLOG_4BYTES, &mtr);
index->id = DICT_INDEXES_ID;
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, (char *) "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, "INDEX_ID", DATA_BINARY, 0,0,0);
+ dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0);
+ dict_mem_table_add_col(table, "COL_NAME", DATA_BINARY, 0,0,0);
table->id = DICT_FIELDS_ID;
dict_table_add_to_cache(table);
dict_sys->sys_fields = table;
- index = dict_mem_index_create((char *) "SYS_FIELDS",
- (char *) "CLUST_IND", DICT_HDR_SPACE,
- DICT_UNIQUE | DICT_CLUSTERED, 2);
+ index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND",
+ DICT_HDR_SPACE, DICT_UNIQUE | DICT_CLUSTERED, 2);
- dict_mem_index_add_field(index, (char *) "INDEX_ID", 0, 0);
- dict_mem_index_add_field(index, (char *) "POS", 0, 0);
+ dict_mem_index_add_field(index, "INDEX_ID", 0, 0);
+ dict_mem_index_add_field(index, "POS", 0, 0);
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_FIELDS,
MLOG_4BYTES, &mtr);
diff --git a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c
index f0b5906ec50..fd8e02585ae 100644
--- a/innobase/dict/dict0crea.c
+++ b/innobase/dict/dict0crea.c
@@ -1004,12 +1004,12 @@ dict_create_or_check_foreign_constraint_tables(void)
que_t* graph;
ulint error;
trx_t* trx;
- char* str;
+ const char* str;
mutex_enter(&(dict_sys->mutex));
- table1 = dict_table_get_low((char *) "SYS_FOREIGN");
- table2 = dict_table_get_low((char *) "SYS_FOREIGN_COLS");
+ table1 = dict_table_get_low("SYS_FOREIGN");
+ table2 = dict_table_get_low("SYS_FOREIGN_COLS");
if (table1 && table2
&& 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->op_info = (char *) "creating foreign key sys tables";
+ trx->op_info = "creating foreign key sys tables";
row_mysql_lock_data_dictionary(trx);
if (table1) {
fprintf(stderr,
"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) {
fprintf(stderr,
"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,
@@ -1050,7 +1050,7 @@ dict_create_or_check_foreign_constraint_tables(void)
there are 2 secondary indexes on SYS_FOREIGN, and they
are defined just like below */
- str = (char *)
+ str =
"PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n"
"BEGIN\n"
"CREATE TABLE\n"
@@ -1090,15 +1090,15 @@ dict_create_or_check_foreign_constraint_tables(void)
fprintf(stderr,
"InnoDB: dropping incompletely created SYS_FOREIGN tables\n");
- row_drop_table_for_mysql((char*)"SYS_FOREIGN", trx, TRUE);
- row_drop_table_for_mysql((char*)"SYS_FOREIGN_COLS", trx, TRUE);
+ row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
+ row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
error = DB_MUST_GET_MORE_FILE_SPACE;
}
que_graph_free(graph);
- trx->op_info = (char *) "";
+ trx->op_info = "";
row_mysql_unlock_data_dictionary(trx);
@@ -1161,7 +1161,7 @@ dict_create_add_foreigns_to_dictionary(
ut_ad(mutex_own(&(dict_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
- if (NULL == dict_table_get_low((char *) "SYS_FOREIGN")) {
+ if (NULL == dict_table_get_low("SYS_FOREIGN")) {
fprintf(stderr,
"InnoDB: table SYS_FOREIGN not found from internal data dictionary\n");
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index 6a6ac2492f8..84a655bcb77 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -198,13 +198,14 @@ dict_tables_have_same_db(
/************************************************************************
Return the end of table name where we have removed dbname and '/'. */
static
-char*
+const char*
dict_remove_db_name(
/*================*/
- /* out: table name */
- char* name) /* in: table name in the form dbname '/' tablename */
+ /* out: table name */
+ const char* name) /* in: table name in the form
+ dbname '/' tablename */
{
- char* s;
+ const char* s;
s = strchr(name, '/');
ut_a(s);
if (s) s++;
@@ -783,23 +784,33 @@ dict_table_add_to_cache(
The clustered index will not always physically contain all
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);
- ut_ad(DATA_ROW_ID == 0);
- dict_mem_table_add_col(table, (char *) "DB_TRX_ID", DATA_SYS,
+#if DATA_ROW_ID != 0
+#error "DATA_ROW_ID != 0"
+#endif
+ dict_mem_table_add_col(table, "DB_TRX_ID", DATA_SYS,
DATA_TRX_ID, 0, 0);
- ut_ad(DATA_TRX_ID == 1);
- dict_mem_table_add_col(table, (char *) "DB_ROLL_PTR", DATA_SYS,
- DATA_ROLL_PTR,
- 0, 0);
- ut_ad(DATA_ROLL_PTR == 2);
+#if DATA_TRX_ID != 1
+#error "DATA_TRX_ID != 1"
+#endif
+ dict_mem_table_add_col(table, "DB_ROLL_PTR", DATA_SYS,
+ 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);
- ut_ad(DATA_MIX_ID == 3);
- ut_ad(DATA_N_SYS_COLS == 4); /* This assert reminds that if a new
- system column is added to the program,
- it should be dealt with here */
+#if DATA_MIX_ID != 3
+#error "DATA_MIX_ID != 3"
+#endif
+
+ /* 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 */
{
@@ -1107,7 +1118,9 @@ dict_table_change_id_in_cache(
dulint new_id) /* in: new id to set */
{
ut_ad(table);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
/* Remove the table from the hash table of id's */
@@ -1973,7 +1986,7 @@ dict_foreign_find(
/*==============*/
/* out: foreign constraint */
dict_table_t* table, /* in: table object */
- char* id) /* in: foreign constraint id */
+ const char* id) /* in: foreign constraint id */
{
dict_foreign_t* foreign;
@@ -2367,7 +2380,7 @@ dict_scan_id(
*id = mem_heap_strdupl(heap, s, len);
} else {
/* no heap given: id will point to source string */
- *id = (char*) s;
+ *id = s;
}
return(ptr);
@@ -2750,7 +2763,7 @@ dict_create_foreign_constraints_low(
ut_ad(mutex_own(&(dict_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
- table = dict_table_get_low((char*) name);
+ table = dict_table_get_low(name);
if (table == NULL) {
mutex_enter(&dict_foreign_err_mutex);
@@ -3936,7 +3949,7 @@ Prints a table data when we know the table name. */
void
dict_table_print_by_name(
/*=====================*/
- char* name)
+ const char* name)
{
dict_table_t* table;
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c
index 071a3b4c684..b55050ee83f 100644
--- a/innobase/dict/dict0load.c
+++ b/innobase/dict/dict0load.c
@@ -51,7 +51,7 @@ dict_get_first_table_name_in_db(
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);
tuple = dtuple_create(heap, 1);
@@ -127,7 +127,7 @@ dict_print(void)
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);
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);
- 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);
btr_pcur_open_at_index_side(TRUE, sys_index, BTR_SEARCH_LEAF, &pcur,
@@ -312,7 +312,7 @@ dict_load_columns(
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);
tuple = dtuple_create(heap, 1);
@@ -342,7 +342,7 @@ dict_load_columns(
ut_ad(len == 4);
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_index_get_nth_field(
dict_table_get_first_index(sys_columns), 4))->name));
@@ -368,7 +368,7 @@ dict_load_columns(
field = rec_get_nth_field(rec, 7, &len);
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_index_get_nth_field(
dict_table_get_first_index(sys_columns), 8))->name));
@@ -438,7 +438,7 @@ dict_load_fields(
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);
tuple = dtuple_create(heap, 1);
@@ -489,7 +489,7 @@ dict_load_fields(
prefix_len = 0;
}
- ut_a(0 == ut_strcmp((char*) "COL_NAME",
+ ut_a(0 == ut_strcmp("COL_NAME",
dict_field_get_col(
dict_index_get_nth_field(
dict_table_get_first_index(sys_fields), 4))->name));
@@ -551,7 +551,7 @@ dict_load_indexes(
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);
tuple = dtuple_create(heap, 1);
@@ -594,7 +594,7 @@ dict_load_indexes(
ut_ad(len == 8);
id = mach_read_from_8(field);
- ut_a(0 == ut_strcmp((char*) "NAME",
+ ut_a(0 == ut_strcmp("NAME",
dict_field_get_col(
dict_index_get_nth_field(
dict_table_get_first_index(sys_indexes), 4))->name));
@@ -611,7 +611,7 @@ dict_load_indexes(
field = rec_get_nth_field(rec, 7, &len);
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_index_get_nth_field(
dict_table_get_first_index(sys_indexes), 8))->name));
@@ -654,7 +654,7 @@ dict_load_indexes(
&& ((type & DICT_CLUSTERED)
|| ((table == dict_sys->sys_tables)
&& (name_len == (sizeof "ID_IND") - 1)
- && (0 == ut_memcmp(name_buf, (char*) "ID_IND",
+ && (0 == ut_memcmp(name_buf, "ID_IND",
name_len))))) {
/* The index was created in memory already at booting
@@ -721,7 +721,7 @@ dict_load_table(
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);
tuple = dtuple_create(heap, 1);
@@ -757,7 +757,7 @@ dict_load_table(
return(NULL);
}
- ut_a(0 == ut_strcmp((char *) "SPACE",
+ ut_a(0 == ut_strcmp("SPACE",
dict_field_get_col(
dict_index_get_nth_field(
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_index_get_nth_field(
dict_table_get_first_index(sys_tables), 4))->name));
@@ -794,7 +794,7 @@ dict_load_table(
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_index_get_nth_field(
dict_table_get_first_index(sys_tables), 3))->name));
@@ -983,7 +983,7 @@ static
void
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 */
dict_foreign_t* foreign)/* in: foreign constraint object */
{
@@ -1009,7 +1009,7 @@ dict_load_foreign_cols(
foreign->n_fields * sizeof(void*));
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);
tuple = dtuple_create(foreign->heap, 1);
@@ -1056,9 +1056,9 @@ static
ulint
dict_load_foreign(
/*==============*/
- /* out: DB_SUCCESS or error code */
- char* id) /* in: foreign constraint id as a null-terminated
- string */
+ /* out: DB_SUCCESS or error code */
+ const char* id) /* in: foreign constraint id as a
+ null-terminated string */
{
dict_foreign_t* foreign;
dict_table_t* sys_foreign;
@@ -1081,7 +1081,7 @@ dict_load_foreign(
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);
tuple = dtuple_create(heap2, 1);
@@ -1207,7 +1207,7 @@ dict_load_foreigns(
ut_ad(mutex_own(&(dict_sys->mutex)));
#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) {
/* No foreign keys defined yet in this database */
diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c
index 28eea0ba188..b076e3a3315 100644
--- a/innobase/fil/fil0fil.c
+++ b/innobase/fil/fil0fil.c
@@ -274,7 +274,7 @@ fil_get_space_id_for_table(
/*=======================*/
/* out: space id, ULINT_UNDEFINED if not
found */
- char* name); /* in: table name in the standard
+ const char* name); /* in: table name in the standard
'databasename/tablename' format */
@@ -463,8 +463,9 @@ fil_node_open_file(
ulint size_high;
ibool ret;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(system->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
ut_a(node->n_pending == 0);
ut_a(node->open == FALSE);
@@ -575,8 +576,9 @@ fil_try_to_close_file_in_LRU(
fil_system_t* system = fil_system;
fil_node_t* node;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(system->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
node = UT_LIST_GET_LAST(system->LRU);
if (print_info) {
@@ -630,7 +632,9 @@ fil_mutex_enter_and_prepare_for_io(
ulint count = 0;
ulint count2 = 0;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&(system->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
retry:
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
space, in database pages */
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* buf;
- UT_NOT_USED(arch_log_no);
-
buf1 = mem_alloc(2 * 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 */
ibool one_read_already, /* in: TRUE if min and max parameters
below already contain sensible data */
- dulint* min_flushed_lsn, /* in/out: */
+#ifdef UNIV_LOG_ARCHIVE
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* buf2;
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);
/* Align the memory for a possible read from a raw device */
buf = ut_align(buf2, UNIV_PAGE_SIZE);
@@ -1420,9 +1422,10 @@ fil_read_flushed_lsn_and_arch_log_no(
if (!one_read_already) {
*min_flushed_lsn = flushed_lsn;
*max_flushed_lsn = flushed_lsn;
+#ifdef UNIV_LOG_ARCHIVE
*min_arch_log_no = arch_log_no;
*max_arch_log_no = arch_log_no;
-
+#endif /* UNIV_LOG_ARCHIVE */
return;
}
@@ -1432,12 +1435,14 @@ fil_read_flushed_lsn_and_arch_log_no(
if (ut_dulint_cmp(*max_flushed_lsn, flushed_lsn) < 0) {
*max_flushed_lsn = flushed_lsn;
}
+#ifdef UNIV_LOG_ARCHIVE
if (*min_arch_log_no > arch_log_no) {
*min_arch_log_no = arch_log_no;
}
if (*max_arch_log_no < arch_log_no) {
*max_arch_log_no = arch_log_no;
}
+#endif /* UNIV_LOG_ARCHIVE */
}
/*================ SINGLE-TABLE TABLESPACES ==========================*/
@@ -1507,33 +1512,31 @@ fil_decr_pending_ibuf_merges(
mutex_exit(&(system->mutex));
}
-/************************************************************
-Creates the database directory for a table if it does not exist yet. */
static
void
fil_create_directory_for_tablename(
/*===============================*/
- char* name) /* in: name in the standard 'databasename/tablename'
- format */
+ const char* name) /* in: name in the standard
+ 'databasename/tablename' format */
{
- char* ptr;
- char path[OS_FILE_MAX_PATH];
-
- sprintf(path, "%s/%s", fil_path_to_mysql_datadir, name);
+ const char* namend;
+ char* path;
+ ulint len;
- ptr = path + ut_strlen(path);
+ len = strlen(fil_path_to_mysql_datadir);
+ namend = strchr(name, '/');
+ ut_a(namend);
+ path = mem_alloc(len + (namend - name) + 2);
- while (*ptr != '/') {
- ptr--;
-
- ut_a(ptr >= path);
- }
-
- *ptr = '\0';
+ memcpy(path, fil_path_to_mysql_datadir, len);
+ path[len] = '/';
+ memcpy(path + len + 1, name, namend - name);
+ path[len + (namend - name) + 1] = 0;
srv_normalize_path_for_win(path);
ut_a(os_file_create_directory(path, FALSE));
+ mem_free(path);
}
#ifndef UNIV_HOTBACKUP
@@ -1615,10 +1618,10 @@ fil_op_log_parse_or_replay(
the tablespace in question; otherwise
ignored */
{
- ulint name_len;
- ulint new_name_len;
- char* name;
- char* new_name = NULL;
+ ulint name_len;
+ ulint new_name_len;
+ const char* name;
+ const char* new_name = NULL;
if (end_ptr < ptr + 2) {
@@ -1634,7 +1637,7 @@ fil_op_log_parse_or_replay(
return(NULL);
}
- name = (char*) ptr;
+ name = (const char*) ptr;
ptr += name_len;
@@ -1653,7 +1656,7 @@ fil_op_log_parse_or_replay(
return(NULL);
}
- new_name = (char*) ptr;
+ new_name = (const char*) ptr;
ptr += new_name_len;
}
@@ -1916,11 +1919,11 @@ fil_rename_tablespace_in_mem(
/* out: TRUE if success */
fil_space_t* space, /* in: tablespace memory object */
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_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),
space2, 0 == strcmp(old_name, space2->name));
@@ -1945,11 +1948,8 @@ fil_rename_tablespace_in_mem(
mem_free(space->name);
mem_free(node->name);
- space->name = mem_alloc(strlen(path) + 1);
- node->name = mem_alloc(strlen(path) + 1);
-
- strcpy(space->name, path);
- strcpy(node->name, path);
+ space->name = mem_strdup(path);
+ node->name = mem_strdup(path);
HASH_INSERT(fil_space_t, name_hash, system->name_hash,
ut_fold_string(path), space);
@@ -1985,7 +1985,7 @@ fil_rename_tablespace(
ut_a(id != 0);
if (old_name == NULL) {
- old_name = (char*)"(name not specified)";
+ old_name = "(name not specified)";
old_name_was_specified = FALSE;
}
retry:
@@ -2532,9 +2532,9 @@ static
void
fil_load_single_table_tablespace(
/*=============================*/
- char* dbname, /* in: database name */
- char* filename) /* in: file name (not a path), including the
- .ibd extension */
+ const char* dbname, /* in: database name */
+ const char* filename) /* in: file name (not a path),
+ including the .ibd extension */
{
os_file_t file;
char* filepath;
@@ -2732,7 +2732,7 @@ fil_load_single_table_tablespaces(void)
/* 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) {
@@ -2744,7 +2744,7 @@ fil_load_single_table_tablespaces(void)
/* Scan all directories under the datadir. They are the database
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);
while (ret == 0) {
/* printf("Looking at %s in datadir\n", dbinfo.name); */
@@ -2805,7 +2805,7 @@ next_file_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);
}
@@ -3066,7 +3066,7 @@ fil_get_space_id_for_table(
/*=======================*/
/* out: space id, ULINT_UNDEFINED if not
found */
- char* name) /* in: table name in the standard
+ const char* name) /* in: table name in the standard
'databasename/tablename' format */
{
fil_system_t* system = fil_system;
diff --git a/innobase/ha/ha0ha.c b/innobase/ha/ha0ha.c
index e8082f016b9..ad1391ff83e 100644
--- a/innobase/ha/ha0ha.c
+++ b/innobase/ha/ha0ha.c
@@ -211,7 +211,9 @@ ha_search_and_update_if_found(
{
ha_node_t* node;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
+#endif /* UNIV_SYNC_DEBUG */
node = ha_search_with_data(table, fold, data);
diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c
index 9246bb03138..931fb7f4168 100644
--- a/innobase/ibuf/ibuf0ibuf.c
+++ b/innobase/ibuf/ibuf0ibuf.c
@@ -530,18 +530,18 @@ ibuf_data_init_for_space(
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,(char *) "TYPES", DATA_BINARY, 0, 0, 0);
+ dict_mem_table_add_col(table, "PAGE_NO", 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);
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_mem_index_add_field(index, (char *) "PAGE_NO", 0, 0);
- dict_mem_index_add_field(index, (char *) "TYPES", 0, 0);
+ dict_mem_index_add_field(index, "PAGE_NO", 0, 0);
+ dict_mem_index_add_field(index, "TYPES", 0, 0);
index->page_no = FSP_IBUF_TREE_ROOT_PAGE_NO;
diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic
index 4d1173a0d7f..fa8421b63ad 100644
--- a/innobase/include/buf0buf.ic
+++ b/innobase/include/buf0buf.ic
@@ -508,7 +508,7 @@ void
buf_block_buf_fix_inc_debug(
/*========================*/
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 */
{
#ifdef UNIV_SYNC_DEBUG
diff --git a/innobase/include/fil0fil.h b/innobase/include/fil0fil.h
index b750e9b38f2..45549aee63c 100644
--- a/innobase/include/fil0fil.h
+++ b/innobase/include/fil0fil.h
@@ -248,10 +248,12 @@ fil_read_flushed_lsn_and_arch_log_no(
os_file_t data_file, /* in: open data file */
ibool one_read_already, /* in: TRUE if min and max parameters
below already contain sensible data */
- dulint* min_flushed_lsn, /* in/out: */
+#ifdef UNIV_LOG_ARCHIVE
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
being deleted. */
diff --git a/innobase/include/log0recv.h b/innobase/include/log0recv.h
index c972c3ce977..658df4d5586 100644
--- a/innobase/include/log0recv.h
+++ b/innobase/include/log0recv.h
@@ -15,7 +15,9 @@ Created 9/20/1997 Heikki Tuuri
#include "hash0hash.h"
#include "log0log.h"
+#ifdef UNIV_HOTBACKUP
extern ibool recv_replay_file_ops;
+#endif /* UNIV_HOTBACKUP */
/***********************************************************************
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
be divisible by OS_FILE_LOG_BLOCK_SIZE,
after which we add LOG_BLOCK_HDR_SIZE */
+#ifdef UNIV_LOG_ARCHIVE
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
at the log creation; FALSE if it is done
after archive recovery */
+#ifdef UNIV_HOTBACKUP
/**********************************************************
Creates new log files after a backup has been restored. */
void
recv_reset_log_files_for_backup(
/*============================*/
- char* log_dir, /* in: log file directory path */
- ulint n_log_files, /* in: number of log files */
- ulint log_file_size, /* in: log file size */
- dulint lsn); /* in: new start lsn */
+ const char* log_dir, /* in: log file directory path */
+ ulint n_log_files, /* in: number of log files */
+ ulint log_file_size, /* in: log file size */
+ dulint lsn); /* in: new start lsn, must be
+ divisible by OS_FILE_LOG_BLOCK_SIZE */
+#endif /* UNIV_HOTBACKUP */
/************************************************************
Creates the recovery system. */
@@ -185,6 +192,7 @@ void
recv_apply_log_recs_for_backup(void);
/*================================*/
#endif
+#ifdef UNIV_LOG_ARCHIVE
/************************************************************
Recovers from archived log files, and also from log files, if they exist. */
@@ -205,6 +213,7 @@ Completes recovery from archive. */
void
recv_recovery_from_archive_finish(void);
/*===================================*/
+#endif /* UNIV_LOG_ARCHIVE */
/***********************************************************************
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_lsn_checks_on;
+#ifdef UNIV_HOTBACKUP
extern ibool recv_is_making_a_backup;
+#endif /* UNIV_HOTBACKUP */
extern ulint recv_max_parsed_page_no;
/* Size of the parsing buffer; it must accommodate RECV_SCAN_SIZE many
diff --git a/innobase/include/mem0dbg.ic b/innobase/include/mem0dbg.ic
index 2e79c814529..00db22eb518 100644
--- a/innobase/include/mem0dbg.ic
+++ b/innobase/include/mem0dbg.ic
@@ -54,7 +54,7 @@ void
mem_hash_insert(
/*============*/
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 */
#ifdef UNIV_MEM_DEBUG
/*******************************************************************
@@ -70,7 +70,7 @@ void
mem_hash_remove(
/*============*/
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 */
#endif /* UNIV_MEM_DEBUG */
diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h
index 7f067c75466..c527d40bc79 100644
--- a/innobase/include/srv0srv.h
+++ b/innobase/include/srv0srv.h
@@ -16,10 +16,7 @@ Created 10/10/1995 Heikki Tuuri
#include "que0types.h"
#include "trx0types.h"
-extern char* srv_main_thread_op_info;
-
-/* Buffer which can be used in printing fatal error messages */
-extern char srv_fatal_errbuf[];
+extern const char* srv_main_thread_op_info;
/* When this event is set the lock timeout and InnoDB monitor
thread starts running */
@@ -40,7 +37,9 @@ extern FILE* srv_monitor_file;
/* Server parameters which are read from the initfile */
extern char* srv_data_home;
+#ifdef UNIV_LOG_ARCHIVE
extern char* srv_arch_dir;
+#endif /* UNIV_LOG_ARCHIVE */
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_files;
extern ulint srv_log_file_size;
-extern ibool srv_log_archive_on;
extern ulint srv_log_buffer_size;
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;
+#ifdef UNIV_LOG_ARCHIVE
+extern ibool srv_log_archive_on;
extern ibool srv_archive_recovery;
extern dulint srv_archive_recovery_limit_lsn;
+#endif /* UNIV_LOG_ARCHIVE */
extern ulint srv_lock_wait_timeout;
diff --git a/innobase/include/sync0rw.ic b/innobase/include/sync0rw.ic
index 655bd7f6517..3a92100ba01 100644
--- a/innobase/include/sync0rw.ic
+++ b/innobase/include/sync0rw.ic
@@ -30,7 +30,7 @@ rw_lock_add_debug_info(
rw_lock_t* lock, /* in: rw-lock */
ulint pass, /* in: pass value */
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 */
/**********************************************************************
Removes a debug information struct for an rw-lock. */
diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic
index ecb498918e2..aaf5e1fd9e9 100644
--- a/innobase/include/sync0sync.ic
+++ b/innobase/include/sync0sync.ic
@@ -33,7 +33,7 @@ void
mutex_set_debug_info(
/*=================*/
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 */
#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
diff --git a/innobase/log/log0log.c b/innobase/log/log0log.c
index 769889a21d7..7d7c7dcf998 100644
--- a/innobase/log/log0log.c
+++ b/innobase/log/log0log.c
@@ -41,9 +41,11 @@ old */
ibool log_has_printed_chkp_warning = FALSE;
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
archive */
byte log_archive_io;
+#endif /* UNIV_LOG_ARCHIVE */
/* 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)
@@ -90,12 +92,14 @@ static
void
log_io_complete_checkpoint(void);
/*============================*/
+#ifdef UNIV_LOG_ARCHIVE
/**********************************************************
Completes an archiving i/o. */
static
void
log_io_complete_archive(void);
/*=========================*/
+#endif /* UNIV_LOG_ARCHIVE */
/********************************************************************
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;
ulint len_upper_limit;
+#ifdef UNIV_LOG_ARCHIVE
ulint archived_lsn_age;
- ulint count = 0;
ulint dummy;
+#endif /* UNIV_LOG_ARCHIVE */
+#ifdef UNIV_DEBUG
+ ulint count = 0;
+#endif /* UNIV_DEBUG */
ut_a(len < log->buf_size / 2);
loop:
@@ -182,13 +190,12 @@ loop:
log_buffer_flush_to_disk();
- count++;
-
- ut_ad(count < 50);
+ ut_ad(++count < 50);
goto loop;
}
+#ifdef UNIV_LOG_ARCHIVE
if (log->archiving_state != LOG_ARCH_OFF) {
archived_lsn_age = ut_dulint_minus(log->lsn,
@@ -204,13 +211,12 @@ loop:
log_archive_do(TRUE, &dummy);
- count++;
-
- ut_ad(count < 50);
+ ut_ad(++count < 50);
goto loop;
}
}
+#endif /* UNIV_LOG_ARCHIVE */
#ifdef UNIV_LOG_DEBUG
log->old_buf_free = log->buf_free;
@@ -378,6 +384,7 @@ function_exit:
return(lsn);
}
+#ifdef UNIV_LOG_ARCHIVE
/**********************************************************
Pads the current log block full with dummy log records. Used in producing
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)
== LOG_BLOCK_HDR_SIZE);
}
+#endif /* UNIV_LOG_ARCHIVE */
/**********************************************************
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_sys->max_checkpoint_age = margin;
+#ifdef UNIV_LOG_ARCHIVE
log_sys->max_archived_lsn_age = smallest_archive_margin;
log_sys->max_archived_lsn_age_async = smallest_archive_margin
- smallest_archive_margin /
LOG_ARCHIVE_RATIO_ASYNC;
+#endif /* UNIV_LOG_ARCHIVE */
failure:
mutex_exit(&(log_sys->mutex));
@@ -767,6 +777,7 @@ log_init(void)
memset(log_sys->checkpoint_buf, '\0', OS_FILE_LOG_BLOCK_SIZE);
/*----------------------------*/
+#ifdef UNIV_LOG_ARCHIVE
/* Under MySQL, log archiving is always off */
log_sys->archiving_state = LOG_ARCH_OFF;
log_sys->archived_lsn = log_sys->lsn;
@@ -788,6 +799,7 @@ log_init(void)
/* memset(log_sys->archive_buf, '\0', LOG_ARCHIVE_BUF_SIZE); */
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
which contains the log files of this
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
files for this group; currently, only
for the first log group this is
@@ -845,7 +858,9 @@ log_group_init(
group->n_pending_writes = 0;
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);
+#endif /* UNIV_LOG_ARCHIVE */
for (i = 0; i < n_files; i++) {
*(group->file_header_bufs + i) = ut_align(
@@ -855,17 +870,21 @@ log_group_init(
memset(*(group->file_header_bufs + i), '\0',
LOG_FILE_HDR_SIZE);
+#ifdef UNIV_LOG_ARCHIVE
*(group->archive_file_header_bufs + i) = ut_align(
mem_alloc(LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE),
OS_FILE_LOG_BLOCK_SIZE);
memset(*(group->archive_file_header_bufs + i), '\0',
LOG_FILE_HDR_SIZE);
+#endif /* UNIV_LOG_ARCHIVE */
}
+#ifdef UNIV_LOG_ARCHIVE
group->archive_space_id = archive_space_id;
group->archived_file_no = 0;
group->archived_offset = 0;
+#endif /* UNIV_LOG_ARCHIVE */
group->checkpoint_buf = ut_align(
mem_alloc(2 * OS_FILE_LOG_BLOCK_SIZE),
@@ -1002,6 +1021,7 @@ log_io_complete(
{
ulint unlock;
+#ifdef UNIV_LOG_ARCHIVE
if ((byte*)group == &log_archive_io) {
/* It was an archive write */
@@ -1009,6 +1029,7 @@ log_io_complete(
return;
}
+#endif /* UNIV_LOG_ARCHIVE */
if ((ulint)group & 0x1UL) {
/* It was a checkpoint write */
@@ -1189,7 +1210,7 @@ loop:
(ulong) group->id, (ulong) next_offset,
(ulong) write_len,
(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 + write_len - OS_FILE_LOG_BLOCK_SIZE));
@@ -1629,8 +1650,10 @@ log_group_checkpoint(
log_group_t* group) /* in: log group */
{
log_group_t* group2;
+#ifdef UNIV_LOG_ARCHIVE
dulint archived_lsn;
dulint next_archived_lsn;
+#endif /* UNIV_LOG_ARCHIVE */
ulint write_offset;
ulint fold;
byte* buf;
@@ -1653,6 +1676,7 @@ log_group_checkpoint(
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) {
archived_lsn = ut_dulint_max;
} else {
@@ -1664,8 +1688,11 @@ log_group_checkpoint(
/* For debugging only */
}
}
-
+
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++) {
log_checkpoint_set_nth_group_info(buf, i, 0, 0);
@@ -1675,8 +1702,13 @@ log_group_checkpoint(
while (group2) {
log_checkpoint_set_nth_group_info(buf, group2->id,
+#ifdef UNIV_LOG_ARCHIVE
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);
}
@@ -2102,16 +2134,18 @@ loop:
len = group->file_size - (source_offset % group->file_size);
}
+#ifdef UNIV_LOG_ARCHIVE
if (type == LOG_ARCHIVE) {
log_sys->n_pending_archive_ios++;
}
+#endif /* UNIV_LOG_ARCHIVE */
log_sys->n_log_ios++;
fil_io(OS_FILE_READ | OS_FILE_LOG, sync, group->space_id,
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);
buf += len;
@@ -2122,6 +2156,7 @@ loop:
}
}
+#ifdef UNIV_LOG_ARCHIVE
/**********************************************************
Generates an archived log file name. */
@@ -2134,8 +2169,6 @@ log_archived_file_name_gen(
currently we only archive the first group */
ulint file_no)/* in: file number */
{
- ut_a(0);
-
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;
#ifdef UNIV_SYNC_DEBUG
- ut_a(0);
-
ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
@@ -2197,8 +2228,6 @@ log_group_archive_completed_header_write(
ulint dest_offset;
#ifdef UNIV_SYNC_DEBUG
- ut_a(0);
-
ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
ut_a(nth_file < group->n_files);
@@ -2240,8 +2269,6 @@ log_group_archive(
ulint open_mode;
#ifdef UNIV_SYNC_DEBUG
- ut_a(0);
-
ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
@@ -2372,8 +2399,6 @@ log_archive_groups(void)
log_group_t* group;
#ifdef UNIV_SYNC_DEBUG
- ut_a(0);
-
ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
@@ -2399,8 +2424,6 @@ log_archive_write_complete_groups(void)
ulint i;
#ifdef UNIV_SYNC_DEBUG
- ut_a(0);
-
ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
@@ -2470,8 +2493,6 @@ log_archive_check_completion_low(void)
/*==================================*/
{
#ifdef UNIV_SYNC_DEBUG
- ut_a(0);
-
ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
@@ -2511,8 +2532,6 @@ log_io_complete_archive(void)
{
log_group_t* group;
- ut_a(0);
-
mutex_enter(&(log_sys->mutex));
group = UT_LIST_GET_FIRST(log_sys->log_groups);
@@ -2548,8 +2567,6 @@ log_archive_do(
dulint start_lsn;
dulint limit_lsn;
- ut_a(0);
-
calc_new_limit = TRUE;
loop:
mutex_enter(&(log_sys->mutex));
@@ -2678,8 +2695,6 @@ log_archive_all(void)
return;
}
- ut_a(0);
-
present_lsn = log_sys->lsn;
mutex_exit(&(log_sys->mutex));
@@ -2724,8 +2739,6 @@ log_archive_close_groups(
return;
}
- ut_a(0);
-
group = UT_LIST_GET_FIRST(log_sys->log_groups);
trunc_len = UNIV_PAGE_SIZE
@@ -2770,8 +2783,6 @@ log_archive_stop(void)
{
ibool success;
- ut_a(0);
-
mutex_enter(&(log_sys->mutex));
if (log_sys->archiving_state != LOG_ARCH_ON) {
@@ -2834,8 +2845,6 @@ log_archive_start(void)
/*===================*/
/* out: DB_SUCCESS or DB_ERROR */
{
- ut_a(0);
-
mutex_enter(&(log_sys->mutex));
if (log_sys->archiving_state != LOG_ARCH_STOPPED) {
@@ -2862,7 +2871,6 @@ log_archive_noarchivelog(void)
/*==========================*/
/* out: DB_SUCCESS or DB_ERROR */
{
- ut_a(0);
loop:
mutex_enter(&(log_sys->mutex));
@@ -2895,7 +2903,6 @@ log_archive_archivelog(void)
/*========================*/
/* out: DB_SUCCESS or DB_ERROR */
{
- ut_a(0);
mutex_enter(&(log_sys->mutex));
if (log_sys->archiving_state == LOG_ARCH_OFF) {
@@ -2914,7 +2921,6 @@ log_archive_archivelog(void)
return(DB_ERROR);
}
-#ifdef notdefined
/********************************************************************
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
@@ -2968,7 +2974,7 @@ loop:
goto loop;
}
}
-#endif
+#endif /* UNIV_LOG_ARCHIVE */
/************************************************************************
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_archive_margin(); */
+#ifdef UNIV_LOG_ARCHIVE
+ log_archive_margin();
+#endif /* UNIV_LOG_ARCHIVE */
mutex_enter(&(log_sys->mutex));
@@ -3047,9 +3055,12 @@ loop:
mutex_enter(&(log_sys->mutex));
- if (log_sys->n_pending_archive_ios
- + log_sys->n_pending_checkpoint_writes
- + log_sys->n_pending_writes > 0) {
+ if (
+#ifdef UNIV_LOG_ARCHIVE
+ 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));
@@ -3063,7 +3074,9 @@ 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);
mutex_enter(&(log_sys->mutex));
@@ -3071,10 +3084,13 @@ loop:
lsn = log_sys->lsn;
if (ut_dulint_cmp(lsn, log_sys->last_checkpoint_lsn) != 0
+#ifdef UNIV_LOG_ARCHIVE
|| (srv_log_archive_on
&& ut_dulint_cmp(lsn,
ut_dulint_add(log_sys->archived_lsn, LOG_BLOCK_HDR_SIZE))
- != 0)) {
+ != 0)
+#endif /* UNIV_LOG_ARCHIVE */
+ ) {
mutex_exit(&(log_sys->mutex));
@@ -3082,15 +3098,17 @@ loop:
}
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) {
-
+
arch_log_no--;
}
-*/
- /* log_archive_close_groups(TRUE); */
+
+ log_archive_close_groups(TRUE);
+#endif /* UNIV_LOG_ARCHIVE */
mutex_exit(&(log_sys->mutex));
@@ -3228,8 +3246,7 @@ log_peek_lsn(
log system mutex */
dulint* lsn) /* out: if returns TRUE, current lsn is here */
{
- if (0 == mutex_enter_nowait(&(log_sys->mutex), (char*)__FILE__,
- __LINE__)) {
+ if (0 == mutex_enter_nowait(&(log_sys->mutex), __FILE__, __LINE__)) {
*lsn = log_sys->lsn;
mutex_exit(&(log_sys->mutex));
diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c
index ff92335188d..49d537d23db 100644
--- a/innobase/log/log0recv.c
+++ b/innobase/log/log0recv.c
@@ -34,10 +34,12 @@ Created 9/20/1997 Heikki Tuuri
#include "dict0boot.h"
#include "fil0fil.h"
+#ifdef UNIV_HOTBACKUP
/* 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
directories which were not included */
ibool recv_replay_file_ops = TRUE;
+#endif /* UNIV_HOTBACKUP */
/* 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 */
@@ -71,7 +73,11 @@ log scan */
ulint recv_scan_print_counter = 0;
ibool recv_is_from_backup = FALSE;
+#ifdef UNIV_HOTBACKUP
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_offset = 0;
@@ -1516,9 +1522,9 @@ skip_this_recv_addr:
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
record. */
@@ -1718,7 +1724,7 @@ recv_compare_spaces_low(
recv_compare_spaces(space1, space2, n_pages);
}
-#endif
+#endif /* UNIV_LOG_REPLICATE */
/***********************************************************************
Tries to parse a single log record and returns its length. */
@@ -2018,11 +2024,13 @@ loop:
becomes identical with the original page */
#ifdef UNIV_LOG_DEBUG
recv_check_incomplete_log_recs(ptr, len);
-#endif
-/* recv_update_replicate(type, space, page_no, body,
+#endif/* UNIV_LOG_DEBUG */
+#ifdef UNIV_LOG_REPLICATE
+ recv_update_replicate(type, space, page_no, body,
ptr + len);
recv_compare_replicate(space, page_no);
-*/
+#endif /* UNIV_LOG_REPLICATE */
+
}
} else {
/* Check that all the records associated with the single mtr
@@ -2055,11 +2063,11 @@ loop:
according to the log record */
#ifdef UNIV_LOG_DEBUG
recv_check_incomplete_log_recs(ptr, len);
-#endif
-/*
+#endif /* UNIV_LOG_DEBUG */
+#ifdef UNIV_LOG_REPLICATE
recv_update_replicate(type, space, page_no,
body, ptr + len);
-*/
+#endif /* UNIV_LOG_REPLICATE */
}
#ifdef UNIV_LOG_DEBUG
@@ -2127,12 +2135,13 @@ loop:
recv_add_to_hash_table(type, space, page_no,
body, ptr + len, old_lsn,
new_recovered_lsn);
+#ifdef UNIV_LOG_REPLICATE
} else {
/* In debug checking, check that the replicate
page has become identical with the original
page */
-
-/* recv_compare_replicate(space, page_no); */
+ recv_compare_replicate(space, page_no);
+#endif /* UNIV_LOG_REPLICATE */
}
ptr += len;
@@ -2576,15 +2585,16 @@ recv_recovery_from_checkpoint_start(
/* Wipe over the label now */
- ut_memcpy(log_hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP,
- (char*)" ", 4);
+ memset(log_hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP,
+ ' ', 4);
/* Write to the log file to wipe over the label */
fil_io(OS_FILE_WRITE | OS_FILE_LOG, TRUE,
max_cp_group->space_id,
0, 0, OS_FILE_LOG_BLOCK_SIZE,
log_hdr_buf, max_cp_group);
}
-
+
+#ifdef UNIV_LOG_ARCHIVE
group = UT_LIST_GET_FIRST(log_sys->log_groups);
while (group) {
@@ -2594,6 +2604,7 @@ recv_recovery_from_checkpoint_start(
group = UT_LIST_GET_NEXT(log_groups, group);
}
+#endif /* UNIV_LOG_ARCHIVE */
if (type == LOG_CHECKPOINT) {
/* 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_no = ut_dulint_add(checkpoint_no, 1);
+#ifdef UNIV_LOG_ARCHIVE
log_sys->archived_lsn = archived_lsn;
+#endif /* UNIV_LOG_ARCHIVE */
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);
+#ifdef UNIV_LOG_ARCHIVE
if (ut_dulint_cmp(archived_lsn, ut_dulint_max) == 0) {
log_sys->archiving_state = LOG_ARCH_OFF;
}
+#endif /* UNIV_LOG_ARCHIVE */
mutex_enter(&(recv_sys->mutex));
@@ -2904,7 +2919,9 @@ recv_reset_logs(
dulint lsn, /* in: reset to this lsn rounded up to
be divisible by OS_FILE_LOG_BLOCK_SIZE,
after which we add LOG_BLOCK_HDR_SIZE */
+#ifdef UNIV_LOG_ARCHIVE
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
at the log creation; FALSE if it is done
after archive recovery */
@@ -2921,9 +2938,10 @@ recv_reset_logs(
while (group) {
group->lsn = log_sys->lsn;
group->lsn_offset = LOG_FILE_HDR_SIZE;
-
+#ifdef UNIV_LOG_ARCHIVE
group->archived_file_no = arch_log_no;
group->archived_offset = 0;
+#endif /* UNIV_LOG_ARCHIVE */
if (!new_logs_created) {
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->last_checkpoint_lsn = ut_dulint_zero;
+#ifdef UNIV_LOG_ARCHIVE
log_sys->archived_lsn = log_sys->lsn;
+#endif /* UNIV_LOG_ARCHIVE */
log_block_init(log_sys->buf, log_sys->lsn);
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));
}
+#ifdef UNIV_HOTBACKUP
/**********************************************************
Creates new log files after a backup has been restored. */
void
recv_reset_log_files_for_backup(
/*============================*/
- char* log_dir, /* in: log file directory path */
- ulint n_log_files, /* in: number of log files */
- ulint log_file_size, /* in: log file size */
- dulint lsn) /* in: new start lsn, must be divisible by
- OS_FILE_LOG_BLOCK_SIZE */
+ const char* log_dir, /* in: log file directory path */
+ ulint n_log_files, /* in: number of log files */
+ ulint log_file_size, /* in: log file size */
+ dulint lsn) /* in: new start lsn, must be
+ divisible by OS_FILE_LOG_BLOCK_SIZE */
{
os_file_t log_file;
ibool success;
@@ -2976,8 +2997,8 @@ recv_reset_log_files_for_backup(
ulint i;
ulint log_dir_len;
char* name;
- static
- char logfilename[] = "ib_logfile";
+ static const
+ char logfilename[] = "ib_logfile";
log_dir_len = strlen(log_dir);
/* reserve space for log_dir, "ib_logfile" and a number */
@@ -3047,7 +3068,9 @@ recv_reset_log_files_for_backup(
mem_free(name);
ut_free(buf);
}
+#endif /* UNIV_HOTBACKUP */
+#ifdef UNIV_LOG_ARCHIVE
/**********************************************************
Reads from the archive of a log group and performs recovery. */
static
@@ -3353,9 +3376,8 @@ void
recv_recovery_from_archive_finish(void)
/*===================================*/
{
- ut_a(0);
-
recv_recovery_from_checkpoint_finish();
recv_recovery_from_backup_on = FALSE;
}
+#endif /* UNIV_LOG_ARCHIVE */
diff --git a/innobase/mem/mem0dbg.c b/innobase/mem/mem0dbg.c
index 5ace0441180..d86784cb048 100644
--- a/innobase/mem/mem0dbg.c
+++ b/innobase/mem/mem0dbg.c
@@ -33,7 +33,7 @@ struct mem_hash_node_struct {
UT_LIST_NODE_T(mem_hash_node_t)
list; /* hash list node */
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 nth_heap;/* this is the nth heap created */
UT_LIST_NODE_T(mem_hash_node_t)
@@ -266,7 +266,7 @@ void
mem_hash_insert(
/*============*/
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 */
{
mem_hash_node_t* new_node;
@@ -309,7 +309,7 @@ void
mem_hash_remove(
/*============*/
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 */
{
mem_hash_node_t* node;
diff --git a/innobase/page/page0page.c b/innobase/page/page0page.c
index aecc2dc4fd2..b5f411c43fc 100644
--- a/innobase/page/page0page.c
+++ b/innobase/page/page0page.c
@@ -325,7 +325,7 @@ page_create(
tuple = dtuple_create(heap, 1);
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);
/* Set the corresponding physical record to its place in the page
@@ -347,7 +347,7 @@ page_create(
tuple = dtuple_create(heap, 1);
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);
supremum_rec = rec_convert_dtuple_to_rec(heap_top, tuple);
diff --git a/innobase/pars/pars0pars.c b/innobase/pars/pars0pars.c
index 12451b4d94d..e4b388cba82 100644
--- a/innobase/pars/pars0pars.c
+++ b/innobase/pars/pars0pars.c
@@ -530,7 +530,7 @@ pars_retrieve_table_def(
/*====================*/
sym_node_t* sym_node) /* in: table node */
{
- char* table_name;
+ const char* table_name;
ut_a(sym_node);
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->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);
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c
index 062f21369a7..fdd6989479d 100644
--- a/innobase/row/row0ins.c
+++ b/innobase/row/row0ins.c
@@ -42,13 +42,14 @@ extern
void
innobase_invalidate_query_cache(
/*============================*/
- trx_t* trx, /* in: transaction which modifies the table */
- char* full_name, /* in: concatenation of database name, null
- char '\0', table name, null char'\0';
- NOTE that in Windows this is always
- in LOWER CASE! */
- ulint full_name_len); /* in: full name length where also the null
- chars count */
+ trx_t* trx, /* in: transaction which modifies
+ the table */
+ const char* full_name, /* in: concatenation of database name,
+ null char '\0', table name, null char
+ '\0'; NOTE that in Windows this is
+ always in LOWER CASE! */
+ ulint full_name_len); /* in: full name length where also the
+ null chars count */
/*************************************************************************
@@ -518,7 +519,7 @@ static
void
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 */
que_thr_t* thr, /* in: query thread whose run_node
is an update node */
@@ -651,25 +652,23 @@ row_ins_foreign_check_on_constraint(
ulint n_to_update;
ulint err;
ulint i;
- char* ptr;
- char table_name_buf[1000];
+ const char* ptr;
+ char* table_name;
ut_a(thr && foreign && pcur && mtr);
+#ifndef UNIV_HOTBACKUP
/* Since we are going to delete or update a row, we have to invalidate
the MySQL query cache for table */
- ut_a(ut_strlen(table->name) < 998);
- strcpy(table_name_buf, table->name);
-
- ptr = strchr(table_name_buf, '/');
+ ptr = strchr(table->name, '/');
ut_a(ptr);
- *ptr = '\0';
+ table_name = mem_strdupl(table->name, ptr - table->name);
/* We call a function in ha_innodb.cc */
-#ifndef UNIV_HOTBACKUP
- innobase_invalidate_query_cache(thr_get_trx(thr), table_name_buf,
- ut_strlen(table->name) + 1);
+ innobase_invalidate_query_cache(thr_get_trx(thr), table_name,
+ ptr - table->name + 1);
+ mem_free(table_name);
#endif
node = thr->run_node;
@@ -677,7 +676,7 @@ row_ins_foreign_check_on_constraint(
(DICT_FOREIGN_ON_DELETE_CASCADE
| 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,
btr_pcur_get_rec(pcur), entry);
@@ -690,7 +689,7 @@ row_ins_foreign_check_on_constraint(
/* This is an UPDATE */
- row_ins_foreign_report_err((char*)"Trying to update",
+ row_ins_foreign_report_err("Trying to update",
thr, foreign,
btr_pcur_get_rec(pcur), entry);
@@ -751,7 +750,7 @@ row_ins_foreign_check_on_constraint(
err = DB_ROW_IS_REFERENCED;
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);
goto nonstandard_exit_func;
@@ -876,7 +875,7 @@ row_ins_foreign_check_on_constraint(
err = DB_ROW_IS_REFERENCED;
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"
"be NULL and the column is declared as not NULL in the child table,",
thr, foreign, btr_pcur_get_rec(pcur), entry);
@@ -1194,7 +1193,7 @@ run_again:
}
} else {
row_ins_foreign_report_err(
- (char*)"Trying to delete or update",
+ "Trying to delete or update",
thr, foreign, rec, entry);
err = DB_ROW_IS_REFERENCED;
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index 61be3a7248e..174b8cbae34 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -691,7 +691,7 @@ row_lock_table_autoinc_for_mysql(
return(DB_SUCCESS);
}
- trx->op_info = (char *) "setting auto-inc lock";
+ trx->op_info = "setting auto-inc lock";
if (node == NULL) {
row_get_prebuilt_insert_row(prebuilt);
@@ -727,14 +727,14 @@ run_again:
goto run_again;
}
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(err);
}
que_thr_stop_for_mysql_no_error(thr, trx);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return((int) err);
}
@@ -774,7 +774,7 @@ row_lock_table_for_mysql(
ut_ad(trx);
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) {
/* Build a dummy select query graph */
@@ -811,14 +811,14 @@ run_again:
goto run_again;
}
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(err);
}
que_thr_stop_for_mysql_no_error(thr, trx);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return((int) err);
}
@@ -869,7 +869,7 @@ row_insert_for_mysql(
return(DB_ERROR);
}
- trx->op_info = (char *) "inserting";
+ trx->op_info = "inserting";
trx_start_if_not_started(trx);
@@ -910,7 +910,7 @@ run_again:
goto run_again;
}
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(err);
}
@@ -927,7 +927,7 @@ run_again:
}
row_update_statistics_if_needed(prebuilt->table);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return((int) err);
}
@@ -1084,7 +1084,7 @@ row_update_for_mysql(
return(DB_ERROR);
}
- trx->op_info = (char *) "updating or deleting";
+ trx->op_info = "updating or deleting";
trx_start_if_not_started(trx);
@@ -1131,7 +1131,7 @@ run_again:
if (err == DB_RECORD_NOT_FOUND) {
trx->error_state = DB_SUCCESS;
- trx->op_info = (char *) "";
+ trx->op_info = "";
return((int) err);
}
@@ -1142,7 +1142,7 @@ run_again:
goto run_again;
}
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(err);
}
@@ -1161,7 +1161,7 @@ run_again:
row_update_statistics_if_needed(prebuilt->table);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return((int) err);
}
@@ -1437,7 +1437,7 @@ row_create_table_for_mysql(
return(DB_ERROR);
}
- trx->op_info = (char *) "creating table";
+ trx->op_info = "creating table";
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));
- trx->op_info = (char *) "";
+ trx->op_info = "";
return((int) err);
}
@@ -1601,7 +1601,7 @@ row_create_index_for_mysql(
#endif /* UNIV_SYNC_DEBUG */
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.
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->op_info = (char *) "";
+ trx->op_info = "";
return((int) err);
}
@@ -1705,7 +1705,7 @@ row_table_add_foreign_constraints(
#endif /* UNIV_SYNC_DEBUG */
ut_a(sql_string);
- trx->op_info = (char *) "adding foreign keys";
+ trx->op_info = "adding foreign keys";
trx_start_if_not_started(trx);
@@ -1749,8 +1749,8 @@ static
int
row_drop_table_for_mysql_in_background(
/*===================================*/
- /* out: error code or DB_SUCCESS */
- char* name) /* in: table name */
+ /* out: error code or DB_SUCCESS */
+ const char* name) /* in: table name */
{
ulint error;
trx_t* trx;
@@ -1955,7 +1955,7 @@ row_discard_tablespace_for_mysql(
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);
/* Serialize data dictionary operations with dictionary mutex:
@@ -2060,7 +2060,7 @@ funct_exit:
trx_commit_for_mysql(trx);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return((int) err);
}
@@ -2085,7 +2085,7 @@ row_import_tablespace_for_mysql(
trx_start_if_not_started(trx);
- trx->op_info = (char*) "importing tablespace";
+ trx->op_info = "importing tablespace";
current_lsn = log_get_lsn();
@@ -2165,7 +2165,7 @@ funct_exit:
trx_commit_for_mysql(trx);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return((int) err);
}
@@ -2274,7 +2274,7 @@ row_drop_table_for_mysql(
return(DB_ERROR);
}
- trx->op_info = (char *) "dropping table";
+ trx->op_info = "dropping table";
trx_start_if_not_started(trx);
@@ -2507,7 +2507,7 @@ funct_exit:
trx_commit_for_mysql(trx);
- trx->op_info = (char *) "";
+ trx->op_info = "";
srv_wake_master_thread();
@@ -2533,7 +2533,7 @@ row_drop_database_for_mysql(
ut_a(name != NULL);
ut_a(name[namelen - 1] == '/');
- trx->op_info = (char *) "dropping database";
+ trx->op_info = "dropping database";
trx_start_if_not_started(trx);
loop:
@@ -2587,7 +2587,7 @@ loop:
trx_commit_for_mysql(trx);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(err);
}
@@ -2738,7 +2738,7 @@ row_rename_table_for_mysql(
return(DB_ERROR);
}
- trx->op_info = (char *) "renaming table";
+ trx->op_info = "renaming table";
trx_start_if_not_started(trx);
if (row_mysql_is_recovered_tmp_table(new_name)) {
@@ -2987,7 +2987,7 @@ funct_exit:
trx_commit_for_mysql(trx);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return((int) err);
}
@@ -3125,7 +3125,7 @@ row_check_table_for_mysql(
ulint ret = DB_SUCCESS;
ulint old_isolation_level;
- prebuilt->trx->op_info = (char *) "checking table";
+ prebuilt->trx->op_info = "checking table";
old_isolation_level = prebuilt->trx->isolation_level;
@@ -3181,7 +3181,7 @@ row_check_table_for_mysql(
ret = DB_ERROR;
}
- prebuilt->trx->op_info = (char *) "";
+ prebuilt->trx->op_info = "";
return(ret);
}
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index ff9b697c02f..8a0da2851a7 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -2806,7 +2806,7 @@ row_search_for_mysql(
/* PHASE 1: Try to pop the row from the prefetch cache */
if (direction == 0) {
- trx->op_info = (char *) "starting index read";
+ trx->op_info = "starting index read";
prebuilt->n_rows_fetched = 0;
prebuilt->n_fetch_cached = 0;
@@ -2817,7 +2817,7 @@ row_search_for_mysql(
row_prebuild_sel_graph(prebuilt);
}
} else {
- trx->op_info = (char *) "fetching rows";
+ trx->op_info = "fetching rows";
if (prebuilt->n_rows_fetched == 0) {
prebuilt->fetch_direction = direction;
@@ -2842,7 +2842,7 @@ row_search_for_mysql(
prebuilt->n_rows_fetched++;
srv_n_rows_read++;
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(DB_SUCCESS);
}
@@ -2854,7 +2854,7 @@ row_search_for_mysql(
cache, but the cache was not full at the time of the
popping: no more rows can exist in the result set */
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(DB_RECORD_NOT_FOUND);
}
@@ -2899,7 +2899,7 @@ row_search_for_mysql(
if (direction != 0 && !prebuilt->used_in_HANDLER) {
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(DB_RECORD_NOT_FOUND);
}
}
@@ -2980,7 +2980,7 @@ row_search_for_mysql(
trx->has_search_latch = FALSE;
}
- trx->op_info = (char *) "";
+ trx->op_info = "";
/* NOTE that we do NOT store the cursor
position */
@@ -3003,7 +3003,7 @@ row_search_for_mysql(
trx->has_search_latch = FALSE;
}
- trx->op_info = (char *) "";
+ trx->op_info = "";
/* NOTE that we do NOT store the cursor
position */
@@ -3550,7 +3550,7 @@ lock_wait_or_error:
/* fputs("Using ", stderr);
dict_index_name_print(stderr, index);
fprintf(stderr, " cnt %lu ret value %lu err\n", cnt, err); */
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(err);
@@ -3573,7 +3573,7 @@ normal_return:
srv_n_rows_read++;
}
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(ret);
}
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index 33adcaa14b8..3817501ae70 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -57,7 +57,7 @@ ulint srv_activity_count = 0;
ibool srv_lock_timeout_and_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 */
@@ -65,7 +65,9 @@ char* srv_main_thread_op_info = (char*) "";
names, where the file name itself may also contain a path */
char* srv_data_home = NULL;
+#ifdef UNIV_LOG_ARCHIVE
char* srv_arch_dir = NULL;
+#endif /* UNIV_LOG_ARCHIVE */
ibool srv_file_per_table = FALSE; /* store to its own file each table
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_files = ULINT_MAX;
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_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;
+#ifdef UNIV_LOG_ARCHIVE
+ibool srv_log_archive_on = FALSE;
ibool srv_archive_recovery = 0;
dulint srv_archive_recovery_limit_lsn;
+#endif /* UNIV_LOG_ARCHIVE */
ulint srv_lock_wait_timeout = 1024 * 1024 * 1024;
@@ -921,11 +925,11 @@ retry:
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);
- trx->op_info = (char*)"";
+ trx->op_info = "";
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
release this thread */
- trx->op_info = (char*)"waiting in InnoDB queue";
+ trx->op_info = "waiting in InnoDB queue";
os_event_wait(slot->event);
- trx->op_info = (char*)"";
+ trx->op_info = "";
os_fast_mutex_lock(&srv_conc_mutex);
@@ -1946,7 +1950,7 @@ loop:
/* ---- When there is database activity by users, we cycle in this
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
+ buf_pool->n_pages_written;
@@ -1970,7 +1974,7 @@ loop:
for (i = 0; i < 10; i++) {
n_ios_old = log_sys->n_log_ios + buf_pool->n_pages_read
+ buf_pool->n_pages_written;
- srv_main_thread_op_info = (char*)"sleeping";
+ srv_main_thread_op_info = "sleeping";
if (!skip_sleep) {
@@ -1983,12 +1987,11 @@ loop:
can drop tables lazily after there no longer are SELECT
queries to them. */
- srv_main_thread_op_info =
- (char*)"doing background drop tables";
+ srv_main_thread_op_info = "doing background drop tables";
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) {
@@ -1999,10 +2002,10 @@ loop:
is issued or the we have specified in my.cnf no flush
at transaction commit */
- srv_main_thread_op_info = (char*)"flushing log";
+ srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk();
- srv_main_thread_op_info = (char*)"making checkpoint";
+ srv_main_thread_op_info = "making checkpoint";
log_free_check();
/* 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
+ buf_pool->n_pages_written;
if (n_pend_ios < 3 && (n_ios - n_ios_old < 5)) {
- 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);
- srv_main_thread_op_info = (char*)"flushing log";
+ srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk();
}
@@ -2067,20 +2069,20 @@ loop:
+ buf_pool->n_pages_written;
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);
- srv_main_thread_op_info = (char*) "flushing log";
+ srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk();
}
/* We run a batch of insert buffer merge every 10 seconds,
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);
- srv_main_thread_op_info = (char*)"flushing log";
+ srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk();
/* We run a full purge every 10 seconds, even if the server
@@ -2097,20 +2099,20 @@ loop:
goto background_loop;
}
- srv_main_thread_op_info = (char*)"purging";
+ srv_main_thread_op_info = "purging";
n_pages_purged = trx_purge();
current_time = time(NULL);
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();
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 */
@@ -2131,13 +2133,13 @@ loop:
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 */
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);
@@ -2161,7 +2163,7 @@ background_loop:
/* The server has been quiet for a while: start running background
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();
@@ -2174,7 +2176,7 @@ background_loop:
os_thread_sleep(100000);
}
- srv_main_thread_op_info = (char*)"purging";
+ srv_main_thread_op_info = "purging";
/* Run a full purge */
@@ -2188,20 +2190,20 @@ background_loop:
break;
}
- srv_main_thread_op_info = (char*)"purging";
+ srv_main_thread_op_info = "purging";
n_pages_purged = trx_purge();
current_time = time(NULL);
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();
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);
if (srv_activity_count != old_activity_count) {
@@ -2210,7 +2212,7 @@ background_loop:
}
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) {
n_bytes_merged = 0;
@@ -2218,7 +2220,7 @@ background_loop:
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);
if (srv_activity_count != old_activity_count) {
@@ -2228,10 +2230,10 @@ background_loop:
mutex_exit(&kernel_mutex);
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);
- srv_main_thread_op_info = (char*)"reserving kernel mutex";
+ srv_main_thread_op_info = "reserving kernel mutex";
mutex_enter(&kernel_mutex);
if (srv_activity_count != old_activity_count) {
@@ -2240,15 +2242,14 @@ flush_loop:
}
mutex_exit(&kernel_mutex);
- srv_main_thread_op_info =
- (char*) "waiting for buffer pool flush to end";
+ srv_main_thread_op_info = "waiting for buffer pool flush to end";
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();
- srv_main_thread_op_info = (char*)"making checkpoint";
+ srv_main_thread_op_info = "making checkpoint";
log_checkpoint(TRUE, FALSE);
@@ -2260,7 +2261,7 @@ 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);
if (srv_activity_count != old_activity_count) {
@@ -2269,8 +2270,7 @@ flush_loop:
}
mutex_exit(&kernel_mutex);
/*
- srv_main_thread_op_info =
- (char*)"archiving log (if log archive is on)";
+ srv_main_thread_op_info = "archiving log (if log archive is on)";
log_archive_do(FALSE, &n_bytes_archived);
*/
@@ -2301,7 +2301,7 @@ flush_loop:
master thread to wait for more server activity */
suspend_thread:
- srv_main_thread_op_info = (char*)"suspending";
+ srv_main_thread_op_info = "suspending";
mutex_enter(&kernel_mutex);
@@ -2315,7 +2315,7 @@ suspend_thread:
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);
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index 68fcb82c6d8..3bf39e6422b 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -628,7 +628,7 @@ open_or_create_log_file(
fil_node_create(name, srv_log_file_size,
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
for archived logs.
Under MySQL, no archiving ever done. */
@@ -636,12 +636,11 @@ open_or_create_log_file(
if (k == 0 && i == 0) {
arch_space_id = 2 * k + 1 + SRV_LOG_SPACE_FIRST_ID;
- fil_space_create((char*) "arch_log_space", arch_space_id,
- FIL_LOG);
+ fil_space_create("arch_log_space", arch_space_id, FIL_LOG);
} else {
arch_space_id = ULINT_UNDEFINED;
}
-#endif
+#endif /* UNIV_LOG_ARCHIVE */
if (i == 0) {
log_group_init(k, srv_n_log_files,
srv_log_file_size * UNIV_PAGE_SIZE,
@@ -662,12 +661,14 @@ open_or_create_data_files(
/* out: DB_SUCCESS or error code */
ibool* create_new_db, /* out: TRUE if new database should be
created */
- dulint* min_flushed_lsn,/* out: min of flushed lsn values in data
- files */
+#ifdef UNIV_LOG_ARCHIVE
ulint* min_arch_log_no,/* out: min of archived log numbers in data
files */
- dulint* max_flushed_lsn,/* 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 */
{
ibool ret;
@@ -820,8 +821,10 @@ open_or_create_data_files(
skip_size_check:
fil_read_flushed_lsn_and_arch_log_no(files[i],
one_opened,
- min_flushed_lsn, min_arch_log_no,
- max_flushed_lsn, max_arch_log_no);
+#ifdef UNIV_LOG_ARCHIVE
+ min_arch_log_no, max_arch_log_no,
+#endif /* UNIV_LOG_ARCHIVE */
+ min_flushed_lsn, max_flushed_lsn);
one_opened = TRUE;
} else {
/* 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;
dulint min_flushed_lsn;
dulint max_flushed_lsn;
+#ifdef UNIV_LOG_ARCHIVE
ulint min_arch_log_no;
ulint max_arch_log_no;
+#endif /* UNIV_LOG_ARCHIVE */
ulint sum_of_new_sizes;
ulint sum_of_data_file_sizes;
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;
#ifndef __WIN__
- } else if (0 == ut_strcmp(srv_file_flush_method_str,
- (char*)"fdatasync")) {
+ } else if (0 == ut_strcmp(srv_file_flush_method_str, "fdatasync")) {
srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
- } else if (0 == ut_strcmp(srv_file_flush_method_str,
- (char*)"O_DSYNC")) {
+ } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DSYNC")) {
srv_unix_file_flush_method = SRV_UNIX_O_DSYNC;
- } else if (0 == ut_strcmp(srv_file_flush_method_str,
- (char*)"O_DIRECT")) {
+ } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT")) {
srv_unix_file_flush_method = SRV_UNIX_O_DIRECT;
- } else if (0 == ut_strcmp(srv_file_flush_method_str,
- (char*)"littlesync")) {
+ } else if (0 == ut_strcmp(srv_file_flush_method_str, "littlesync")) {
srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;
- } else if (0 == ut_strcmp(srv_file_flush_method_str,
- (char*)"nosync")) {
+ } else if (0 == ut_strcmp(srv_file_flush_method_str, "nosync")) {
srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
#else
- } else if (0 == ut_strcmp(srv_file_flush_method_str,
- (char*)"normal")) {
+ } else if (0 == ut_strcmp(srv_file_flush_method_str, "normal")) {
srv_win_file_flush_method = SRV_WIN_IO_NORMAL;
os_aio_use_native_aio = FALSE;
@@ -1181,6 +1180,7 @@ NetWare. */
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)) {
fprintf(stderr,
"InnoDB: Error: you must set the log group home dir in my.cnf the\n"
@@ -1188,6 +1188,7 @@ NetWare. */
return(DB_ERROR);
}
+#endif /* UNIV_LOG_ARCHIVE */
if (srv_n_log_files * srv_log_file_size >= 262144) {
fprintf(stderr,
@@ -1219,8 +1220,10 @@ NetWare. */
}
err = open_or_create_data_files(&create_new_db,
- &min_flushed_lsn, &min_arch_log_no,
- &max_flushed_lsn, &max_arch_log_no,
+#ifdef UNIV_LOG_ARCHIVE
+ &min_arch_log_no, &max_arch_log_no,
+#endif /* UNIV_LOG_ARCHIVE */
+ &min_flushed_lsn, &max_flushed_lsn,
&sum_of_new_sizes);
if (err != DB_SUCCESS) {
fprintf(stderr,
@@ -1235,8 +1238,10 @@ NetWare. */
return((int) err);
}
+#ifdef UNIV_LOG_ARCHIVE
srv_normalize_path_for_win(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++) {
err = open_or_create_log_file(create_new_db, &log_file_created,
@@ -1270,9 +1275,16 @@ NetWare. */
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
- || 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,
"InnoDB: Cannot initialize created log files because\n"
"InnoDB: data files were not in sync with each other\n"
@@ -1295,10 +1307,14 @@ NetWare. */
mutex_enter(&(log_sys->mutex));
+#ifdef UNIV_LOG_ARCHIVE
/* Do not + 1 arch_log_no because we do not use log
archiving */
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));
}
@@ -1313,6 +1329,7 @@ NetWare. */
dict_create();
srv_startup_is_before_trx_rollback_phase = FALSE;
+#ifdef UNIV_LOG_ARCHIVE
} else if (srv_archive_recovery) {
fprintf(stderr,
"InnoDB: Starting archive recovery from a backup...\n");
@@ -1336,6 +1353,7 @@ NetWare. */
fsp_header_get_free_limit(0);
recv_recovery_from_archive_finish();
+#endif /* UNIV_LOG_ARCHIVE */
} else {
/* We always try to do a recovery, even if the database had
been shut down normally: this is the normal startup path */
@@ -1384,7 +1402,7 @@ NetWare. */
log_make_checkpoint_at(ut_dulint_max, TRUE);
-#ifdef notdefined
+#ifdef UNIV_LOG_ARCHIVE
/* Archiving is always off under MySQL */
if (!srv_log_archive_on) {
ut_a(DB_SUCCESS == log_archive_noarchivelog());
@@ -1403,7 +1421,7 @@ NetWare. */
ut_a(DB_SUCCESS == log_archive_archivelog());
}
}
-#endif
+#endif /* UNIV_LOG_ARCHIVE */
if (!create_new_db && srv_force_recovery == 0) {
/* After a crash recovery we only check that the info in data
dictionary is consistent with what we already know about space
diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c
index 769eb326ce2..2d3b48b1d89 100644
--- a/innobase/sync/sync0rw.c
+++ b/innobase/sync/sync0rw.c
@@ -119,8 +119,8 @@ rw_lock_create_func(
lock->cfile_name = cfile_name;
lock->cline = cline;
- lock->last_s_file_name = (char *) "not yet reserved";
- lock->last_x_file_name = (char *) "not yet reserved";
+ lock->last_s_file_name = "not yet reserved";
+ lock->last_x_file_name = "not yet reserved";
lock->last_s_line = 0;
lock->last_x_line = 0;
@@ -593,7 +593,7 @@ rw_lock_add_debug_info(
rw_lock_t* lock, /* in: rw-lock */
ulint pass, /* in: pass value */
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 */
{
rw_lock_debug_t* info;
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index 31f287b6341..89bfb5dd02e 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -214,7 +214,7 @@ mutex_create_func(
mutex->magic_n = MUTEX_MAGIC_N;
#ifdef UNIV_SYNC_DEBUG
mutex->line = 0;
- mutex->file_name = (char *) "not yet reserved";
+ mutex->file_name = "not yet reserved";
#endif /* UNIV_SYNC_DEBUG */
mutex->level = SYNC_LEVEL_NONE;
mutex->cfile_name = cfile_name;
@@ -512,7 +512,7 @@ void
mutex_set_debug_info(
/*=================*/
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 */
{
ut_ad(mutex);
diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c
index 4343249764e..8b8a079bb7f 100644
--- a/innobase/trx/trx0roll.c
+++ b/innobase/trx/trx0roll.c
@@ -116,11 +116,11 @@ trx_rollback_for_mysql(
return(DB_SUCCESS);
}
- trx->op_info = (char *) "rollback";
+ trx->op_info = "rollback";
err = trx_general_rollback_for_mysql(trx, FALSE, NULL);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(err);
}
@@ -141,14 +141,14 @@ trx_rollback_last_sql_stat_for_mysql(
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,
&(trx->last_sql_stat_start));
/* The following call should not be needed, but we play safe: */
trx_mark_sql_stat_end(trx);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(err);
}
@@ -239,7 +239,7 @@ trx_rollback_to_savepoint_for_mysql(
*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));
@@ -248,7 +248,7 @@ trx_rollback_to_savepoint_for_mysql(
trx_mark_sql_stat_end(trx);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(err);
}
@@ -343,7 +343,7 @@ trx_rollback_or_clean_all_without_sess(void)
trx_t* trx;
dict_table_t* table;
ib_longlong rows_to_undo;
- char* unit = (char*)"";
+ const char* unit = "";
int err;
mutex_enter(&kernel_mutex);
@@ -421,7 +421,7 @@ loop:
rows_to_undo = trx_roll_max_undo_no;
if (rows_to_undo > 1000000000) {
rows_to_undo = rows_to_undo / 1000000;
- unit = (char*)"M";
+ unit = "M";
}
fprintf(stderr,
diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c
index 7e35e34f014..b377bdb9809 100644
--- a/innobase/trx/trx0sys.c
+++ b/innobase/trx/trx0sys.c
@@ -832,7 +832,7 @@ trx_sys_init_at_db_start(void)
{
trx_sysf_t* sys_header;
ib_longlong rows_to_undo = 0;
- char* unit = (char*)"";
+ const char* unit = "";
trx_t* trx;
mtr_t mtr;
@@ -881,7 +881,7 @@ trx_sys_init_at_db_start(void)
}
if (rows_to_undo > 1000000000) {
- unit = (char*)"M";
+ unit = "M";
rows_to_undo = rows_to_undo / 1000000;
}
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index 862229ef032..afef08dc100 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -81,7 +81,7 @@ trx_create(
trx->magic_n = TRX_MAGIC_N;
- trx->op_info = (char *) "";
+ trx->op_info = "";
trx->type = TRX_USER;
trx->conc_state = TRX_NOT_STARTED;
@@ -107,7 +107,7 @@ trx_create(
trx->mysql_log_file_name = NULL;
trx->mysql_log_offset = 0;
- trx->mysql_master_log_file_name = (char*)"";
+ trx->mysql_master_log_file_name = "";
trx->mysql_master_log_pos = 0;
mutex_create(&(trx->undo_mutex));
@@ -1394,7 +1394,7 @@ trx_commit_for_mysql(
ut_a(trx);
- trx->op_info = (char *) "committing";
+ trx->op_info = "committing";
trx_start_if_not_started(trx);
@@ -1404,7 +1404,7 @@ trx_commit_for_mysql(
mutex_exit(&kernel_mutex);
- trx->op_info = (char *) "";
+ trx->op_info = "";
return(0);
}
@@ -1423,7 +1423,7 @@ trx_commit_complete_for_mysql(
ut_a(trx);
- trx->op_info = (char*)"flushing log";
+ trx->op_info = "flushing log";
if (srv_flush_log_at_trx_commit == 0) {
/* Do nothing */
@@ -1447,7 +1447,7 @@ trx_commit_complete_for_mysql(
ut_error;
}
- trx->op_info = (char*)"";
+ trx->op_info = "";
return(0);
}