Commit ae0ae671 authored by marko's avatar marko

branches/zip: Correctly print the names of temporary tables and indexes

during fast index creation.

TEMP_TABLE_PREFIX: Move the definition from dict0dict.h to ut0ut.h.

ut_print_namel(): Check if the name starts with TEMP_TABLE_PREFIX.

innobase_rename_table(): Print all names with ut_print_name().

row_prebuilt_free(): Replace assert() with ut_a().
parent 99efc2ae
...@@ -5348,22 +5348,10 @@ innobase_rename_table( ...@@ -5348,22 +5348,10 @@ innobase_rename_table(
if (error != DB_SUCCESS) { if (error != DB_SUCCESS) {
FILE* ef = dict_foreign_err_file; FILE* ef = dict_foreign_err_file;
fputs("InnoDB: Rename from old name ", ef); fputs("InnoDB: Renaming table ", ef);
if (*norm_from != TEMP_TABLE_PREFIX) {
ut_print_name(ef, trx, TRUE, norm_from); ut_print_name(ef, trx, TRUE, norm_from);
} else {
fputs(norm_from, ef);
}
fputs(" to ", ef); fputs(" to ", ef);
if (*norm_to != TEMP_TABLE_PREFIX) {
ut_print_name(ef, trx, TRUE, norm_to); ut_print_name(ef, trx, TRUE, norm_to);
} else {
fputs(norm_to, ef);
}
fputs(" failed!\n", ef); fputs(" failed!\n", ef);
} }
......
...@@ -1244,10 +1244,6 @@ struct dict_sys_struct{ ...@@ -1244,10 +1244,6 @@ struct dict_sys_struct{
dict_table_t* sys_fields; /* SYS_FIELDS table */ dict_table_t* sys_fields; /* SYS_FIELDS table */
}; };
#define TEMP_TABLE_PREFIX '/' /* Table name prefix for temporary
internal tables. Used in fast index
creation etc. */
#ifndef UNIV_NONINL #ifndef UNIV_NONINL
#include "dict0dict.ic" #include "dict0dict.ic"
#endif #endif
......
...@@ -15,6 +15,10 @@ Created 1/20/1994 Heikki Tuuri ...@@ -15,6 +15,10 @@ Created 1/20/1994 Heikki Tuuri
#include <ctype.h> #include <ctype.h>
#endif #endif
#define TEMP_TABLE_PREFIX '/' /* Table name prefix for temporary
internal tables. Used in fast index
creation etc. */
typedef time_t ib_time_t; typedef time_t ib_time_t;
/************************************************************ /************************************************************
......
...@@ -753,8 +753,6 @@ row_prebuilt_free( ...@@ -753,8 +753,6 @@ row_prebuilt_free(
added = row_add_table_to_background_drop_list(prebuilt->table); added = row_add_table_to_background_drop_list(prebuilt->table);
assert(*prebuilt->table->name == TEMP_TABLE_PREFIX);
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
if (added) { if (added) {
...@@ -769,6 +767,8 @@ row_prebuilt_free( ...@@ -769,6 +767,8 @@ row_prebuilt_free(
prebuilt->table->name); prebuilt->table->name);
fputs(" to the background drop list.\n", stderr); fputs(" to the background drop list.\n", stderr);
} }
ut_a(*prebuilt->table->name == TEMP_TABLE_PREFIX);
} }
UT_LIST_REMOVE(prebuilts, prebuilt->table->prebuilts, prebuilt); UT_LIST_REMOVE(prebuilts, prebuilt->table->prebuilts, prebuilt);
......
...@@ -467,7 +467,30 @@ ut_print_namel( ...@@ -467,7 +467,30 @@ ut_print_namel(
#else #else
char* slash = memchr(name, '/', namelen); char* slash = memchr(name, '/', namelen);
if (UNIV_LIKELY_NULL(slash)) { if (UNIV_UNLIKELY(*name == TEMP_TABLE_PREFIX)) {
slash = memchr(name + 1, '/', namelen);
if (UNIV_LIKELY(slash && slash >= name + 2)) {
ut_ad(table_id);
/* Database */
innobase_print_identifier(f, trx, TRUE, name + 2,
slash - (name + 2));
putc('.', f);
/* Table */
innobase_print_identifier(f, trx, TRUE, slash + 1,
namelen
- (slash - (name + 3)));
/* Identifier of temporary table */
fprintf(f, "--temporary %c--", name[1]);
} else {
ut_ad(!table_id);
/* Temporary index */
innobase_print_identifier(f, trx, table_id, name + 1,
namelen - 1);
fputs("--temporary--", f);
}
} else if (UNIV_LIKELY_NULL(slash)) {
/* Print the database name and table name separately. */ /* Print the database name and table name separately. */
ut_ad(table_id); ut_ad(table_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment