summaryrefslogtreecommitdiff
path: root/innobase/row
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/row
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/row')
-rw-r--r--innobase/row/row0ins.c45
-rw-r--r--innobase/row/row0mysql.c64
-rw-r--r--innobase/row/row0sel.c18
3 files changed, 63 insertions, 64 deletions
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);
}