Commit c056d2c3 authored by marko's avatar marko

branches/zip: Introduce TEMP_INDEX_PREFIX == 0xff for indexes being populated

in fast index creation.  The prefix was previously TEMP_TABLE_PREFIX == '/',
which may occur in index names.

ut_print_namel(): Do not assume that all '/' are separators between
database and table names.
parent 31d63cd0
...@@ -8022,7 +8022,7 @@ innobase_create_index_def( ...@@ -8022,7 +8022,7 @@ innobase_create_index_def(
len + !new_primary); len + !new_primary);
if (UNIV_LIKELY(!new_primary)) { if (UNIV_LIKELY(!new_primary)) {
*index_name++ = TEMP_TABLE_PREFIX; *index_name++ = TEMP_INDEX_PREFIX;
} }
memcpy(index_name, key->name, len); memcpy(index_name, key->name, len);
......
...@@ -16,8 +16,9 @@ Created 1/20/1994 Heikki Tuuri ...@@ -16,8 +16,9 @@ Created 1/20/1994 Heikki Tuuri
#endif #endif
#define TEMP_TABLE_PREFIX '/' /* Table name prefix for temporary #define TEMP_TABLE_PREFIX '/' /* Table name prefix for temporary
internal tables. Used in fast index tables used in fast index creation */
creation etc. */ #define TEMP_INDEX_PREFIX '\377' /* Index name prefix in fast index
creation */
typedef time_t ib_time_t; typedef time_t ib_time_t;
......
...@@ -1698,7 +1698,7 @@ row_merge_rename_index( ...@@ -1698,7 +1698,7 @@ row_merge_rename_index(
pars_info_t* info = pars_info_create(); pars_info_t* info = pars_info_create();
/* Only rename from temp names */ /* Only rename from temp names */
ut_a(*index->name == TEMP_TABLE_PREFIX); ut_a(*index->name == TEMP_INDEX_PREFIX);
/* We use the private SQL parser of Innobase to generate the /* We use the private SQL parser of Innobase to generate the
query graphs needed in renaming index. */ query graphs needed in renaming index. */
......
...@@ -427,7 +427,7 @@ row_undo_mod_del_unmark_sec_and_undo_update( ...@@ -427,7 +427,7 @@ row_undo_mod_del_unmark_sec_and_undo_update(
mtr_start(&mtr); mtr_start(&mtr);
/* Ignore indexes that are being created. */ /* Ignore indexes that are being created. */
if (UNIV_UNLIKELY(*index->name == TEMP_TABLE_PREFIX)) { if (UNIV_UNLIKELY(*index->name == TEMP_INDEX_PREFIX)) {
return(DB_SUCCESS); return(DB_SUCCESS);
} }
......
...@@ -453,12 +453,13 @@ ut_print_namel( ...@@ -453,12 +453,13 @@ ut_print_namel(
#ifdef UNIV_HOTBACKUP #ifdef UNIV_HOTBACKUP
fwrite(name, 1, namelen, f); fwrite(name, 1, namelen, f);
#else #else
char* slash = memchr(name, '/', namelen); if (table_id) {
char* slash;
if (UNIV_UNLIKELY(*name == TEMP_TABLE_PREFIX)) { if (UNIV_UNLIKELY(*name == TEMP_TABLE_PREFIX)) {
slash = memchr(name + 1, '/', namelen); slash = memchr(name + 1, '/', namelen);
if (UNIV_LIKELY(slash && slash >= name + 2)) {
ut_ad(table_id); ut_ad(slash && slash >= name + 2);
/* Database */ /* Database */
innobase_print_identifier(f, trx, TRUE, name + 2, innobase_print_identifier(f, trx, TRUE, name + 2,
...@@ -470,23 +471,29 @@ ut_print_namel( ...@@ -470,23 +471,29 @@ ut_print_namel(
- (slash - (name + 3))); - (slash - (name + 3)));
/* Identifier of temporary table */ /* Identifier of temporary table */
fprintf(f, "--temporary %c--", name[1]); fprintf(f, "--temporary %c--", name[1]);
} else { return;
ut_ad(!table_id); }
slash = memchr(name, '/', namelen);
/* Temporary index */ if (!slash) {
innobase_print_identifier(f, trx, table_id, name + 1,
namelen - 1); goto no_db_name;
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);
innobase_print_identifier(f, trx, TRUE, name, slash - name); innobase_print_identifier(f, trx, TRUE, name, slash - name);
putc('.', f); putc('.', f);
innobase_print_identifier(f, trx, TRUE, slash + 1, innobase_print_identifier(f, trx, TRUE, slash + 1,
namelen - (slash - name) - 1); namelen - (slash - name) - 1);
} else if (UNIV_UNLIKELY(*name == TEMP_INDEX_PREFIX)) {
/* Temporary index */
innobase_print_identifier(f, trx, table_id, name + 1,
namelen - 1);
fputs("--temporary--", f);
} else { } else {
no_db_name:
innobase_print_identifier(f, trx, table_id, name, namelen); innobase_print_identifier(f, trx, table_id, name, namelen);
} }
#endif #endif
......
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