summaryrefslogtreecommitdiff
path: root/innobase/dict/dict0load.c
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/dict/dict0load.c')
-rw-r--r--innobase/dict/dict0load.c78
1 files changed, 35 insertions, 43 deletions
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c
index ee4ae9dd1a1..d430eadc97b 100644
--- a/innobase/dict/dict0load.c
+++ b/innobase/dict/dict0load.c
@@ -30,7 +30,7 @@ dict_get_first_table_name_in_db(
/* out, own: table name, NULL if
does not exist; the caller must
free the memory in the string! */
- const char* name) /* in: database name which ends to '/' */
+ const char* name) /* in: database name which ends in '/' */
{
dict_table_t* sys_tables;
btr_pcur_t pcur;
@@ -92,7 +92,7 @@ loop:
/* We found one */
- char* table_name = mem_strdupl(field, len);
+ char* table_name = mem_strdupl((char*) field, len);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@@ -154,7 +154,7 @@ loop:
/* We found one */
- char* table_name = mem_strdupl(field, len);
+ char* table_name = mem_strdupl((char*) field, len);
btr_pcur_store_position(&pcur, &mtr);
@@ -165,7 +165,7 @@ loop:
if (table == NULL) {
fputs("InnoDB: Failed to load table ", stderr);
- ut_print_namel(stderr, field, len);
+ ut_print_namel(stderr, NULL, field, len);
putc('\n', stderr);
} else {
/* The table definition was corrupt if there
@@ -246,7 +246,7 @@ loop:
/* We found one */
- char* name = mem_strdupl(field, len);
+ char* name = mem_strdupl((char*) field, len);
field = rec_get_nth_field(rec, 9, &len);
ut_a(len == 4);
@@ -262,7 +262,7 @@ loop:
exists; print a warning to the .err log if not */
fil_space_for_table_exists_in_mem(space_id, name,
- TRUE, TRUE);
+ FALSE, TRUE, TRUE);
}
mem_free(name);
@@ -347,7 +347,7 @@ dict_load_columns(
dict_table_get_first_index(sys_columns), 4))->name));
field = rec_get_nth_field(rec, 4, &len);
- name = mem_heap_strdupl(heap, field, len);
+ name = mem_heap_strdupl(heap, (char*) field, len);
field = rec_get_nth_field(rec, 5, &len);
mtype = mach_read_from_4(field);
@@ -389,18 +389,16 @@ Report that an index field or index for a table has been delete marked. */
static
void
dict_load_report_deleted_index(
+/*===========================*/
const char* name, /* in: table name */
ulint field) /* in: index field, or ULINT_UNDEFINED */
{
- fputs("InnoDB: Error: data dictionary entry"
- " for table ", stderr);
- ut_print_name(stderr, name);
- fputs(" is corrupt!\n", stderr);
+ fprintf(stderr, "InnoDB: Error: data dictionary entry"
+ " for table %s is corrupt!\n", name);
if (field != ULINT_UNDEFINED) {
fprintf(stderr,
"InnoDB: Index field %lu is delete marked.\n", field);
- }
- else {
+ } else {
fputs("InnoDB: An index is delete marked.\n", stderr);
}
}
@@ -496,7 +494,7 @@ dict_load_fields(
field = rec_get_nth_field(rec, 4, &len);
dict_mem_index_add_field(index,
- mem_heap_strdupl(heap, field, len), 0, prefix_len);
+ mem_heap_strdupl(heap, (char*) field, len), 0, prefix_len);
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
}
@@ -599,7 +597,7 @@ dict_load_indexes(
dict_table_get_first_index(sys_indexes), 4))->name));
field = rec_get_nth_field(rec, 4, &name_len);
- name_buf = mem_heap_strdupl(heap, field, name_len);
+ name_buf = mem_heap_strdupl(heap, (char*) field, name_len);
field = rec_get_nth_field(rec, 5, &len);
n_fields = mach_read_from_4(field);
@@ -620,12 +618,10 @@ dict_load_indexes(
if (page_no == FIL_NULL) {
- fputs("InnoDB: Error: trying to load index ", stderr);
- ut_print_name(stderr, name_buf);
- fputs(" for table ", stderr);
- ut_print_name(stderr, table->name);
- fputs("\n"
- "InnoDB: but the index tree has been freed!\n", stderr);
+ fprintf(stderr,
+ "InnoDB: Error: trying to load index %s for table %s\n"
+ "InnoDB: but the index tree has been freed!\n",
+ name_buf, table->name);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@@ -636,12 +632,10 @@ dict_load_indexes(
if ((type & DICT_CLUSTERED) == 0
&& NULL == dict_table_get_first_index(table)) {
- fputs("InnoDB: Error: trying to load index ", stderr);
- ut_print_namel(stderr, name_buf, name_len);
- fputs(" for table ", stderr);
- ut_print_name(stderr, table->name);
- fputs("\n"
- "InnoDB: but the first index is not clustered!\n", stderr);
+ fprintf(stderr,
+ "InnoDB: Error: trying to load index %s for table %s\n"
+ "InnoDB: but the first index is not clustered!\n",
+ name_buf, table->name);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@@ -767,7 +761,7 @@ dict_load_table(
/* Check if the tablespace exists and has the right name */
if (space != 0) {
if (fil_space_for_table_exists_in_mem(space, name, FALSE,
- FALSE)) {
+ FALSE, FALSE)) {
/* Ok; (if we did a crash recovery then the tablespace
can already be in the memory cache) */
} else {
@@ -811,7 +805,7 @@ dict_load_table(
table->mix_id = mach_read_from_8(field);
field = rec_get_nth_field(rec, 8, &len);
- table->cluster_name = mem_heap_strdupl(heap, field, len);
+ table->cluster_name = mem_heap_strdupl(heap, (char*) field, len);
#endif
}
@@ -944,7 +938,7 @@ dict_load_table_on_id(
/* Now we get the table name from the record */
field = rec_get_nth_field(rec, 1, &len);
/* Load the table definition to memory */
- table = dict_load_table(mem_heap_strdupl(heap, field, len));
+ table = dict_load_table(mem_heap_strdupl(heap, (char*) field, len));
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@@ -1036,11 +1030,11 @@ dict_load_foreign_cols(
field = rec_get_nth_field(rec, 4, &len);
foreign->foreign_col_names[i] =
- mem_heap_strdupl(foreign->heap, field, len);
+ mem_heap_strdupl(foreign->heap, (char*) field, len);
field = rec_get_nth_field(rec, 5, &len);
foreign->referenced_col_names[i] =
- mem_heap_strdupl(foreign->heap, field, len);
+ mem_heap_strdupl(foreign->heap, (char*) field, len);
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
}
@@ -1097,10 +1091,9 @@ dict_load_foreign(
|| rec_get_deleted_flag(rec)) {
/* Not found */
- fputs("InnoDB: Error A: cannot load foreign constraint ",
- stderr);
- ut_print_name(stderr, id);
- putc('\n', stderr);
+ fprintf(stderr,
+ "InnoDB: Error A: cannot load foreign constraint %s\n",
+ id);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@@ -1114,10 +1107,9 @@ dict_load_foreign(
/* Check if the id in record is the searched one */
if (len != ut_strlen(id) || ut_memcmp(id, field, len) != 0) {
- fputs("InnoDB: Error B: cannot load foreign constraint ",
- stderr);
- ut_print_name(stderr, id);
- putc('\n', stderr);
+ fprintf(stderr,
+ "InnoDB: Error B: cannot load foreign constraint %s\n",
+ id);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@@ -1146,11 +1138,11 @@ dict_load_foreign(
field = rec_get_nth_field(rec, 3, &len);
foreign->foreign_table_name =
- mem_heap_strdupl(foreign->heap, field, len);
+ mem_heap_strdupl(foreign->heap, (char*) field, len);
field = rec_get_nth_field(rec, 4, &len);
foreign->referenced_table_name =
- mem_heap_strdupl(foreign->heap, field, len);
+ mem_heap_strdupl(foreign->heap, (char*) field, len);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@@ -1264,7 +1256,7 @@ loop:
/* Now we get a foreign key constraint id */
field = rec_get_nth_field(rec, 1, &len);
- id = mem_heap_strdupl(heap, field, len);
+ id = mem_heap_strdupl(heap, (char*) field, len);
btr_pcur_store_position(&pcur, &mtr);