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(
if (error != DB_SUCCESS) {
FILE* ef = dict_foreign_err_file;
fputs("InnoDB: Rename from old name ", ef);
if (*norm_from != TEMP_TABLE_PREFIX) {
fputs("InnoDB: Renaming table ", ef);
ut_print_name(ef, trx, TRUE, norm_from);
} else {
fputs(norm_from, ef);
}
fputs(" to ", ef);
if (*norm_to != TEMP_TABLE_PREFIX) {
ut_print_name(ef, trx, TRUE, norm_to);
} else {
fputs(norm_to, ef);
}
fputs(" failed!\n", ef);
}
......
......@@ -1244,10 +1244,6 @@ struct dict_sys_struct{
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
#include "dict0dict.ic"
#endif
......
......@@ -15,6 +15,10 @@ Created 1/20/1994 Heikki Tuuri
#include <ctype.h>
#endif
#define TEMP_TABLE_PREFIX '/' /* Table name prefix for temporary
internal tables. Used in fast index
creation etc. */
typedef time_t ib_time_t;
/************************************************************
......
......@@ -753,8 +753,6 @@ row_prebuilt_free(
added = row_add_table_to_background_drop_list(prebuilt->table);
assert(*prebuilt->table->name == TEMP_TABLE_PREFIX);
ut_print_timestamp(stderr);
if (added) {
......@@ -769,6 +767,8 @@ row_prebuilt_free(
prebuilt->table->name);
fputs(" to the background drop list.\n", stderr);
}
ut_a(*prebuilt->table->name == TEMP_TABLE_PREFIX);
}
UT_LIST_REMOVE(prebuilts, prebuilt->table->prebuilts, prebuilt);
......
......@@ -467,7 +467,30 @@ ut_print_namel(
#else
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. */
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