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(
len + !new_primary);
if (UNIV_LIKELY(!new_primary)) {
*index_name++ = TEMP_TABLE_PREFIX;
*index_name++ = TEMP_INDEX_PREFIX;
}
memcpy(index_name, key->name, len);
......
......@@ -16,8 +16,9 @@ Created 1/20/1994 Heikki Tuuri
#endif
#define TEMP_TABLE_PREFIX '/' /* Table name prefix for temporary
internal tables. Used in fast index
creation etc. */
tables used in fast index creation */
#define TEMP_INDEX_PREFIX '\377' /* Index name prefix in fast index
creation */
typedef time_t ib_time_t;
......
......@@ -1698,7 +1698,7 @@ row_merge_rename_index(
pars_info_t* info = pars_info_create();
/* 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
query graphs needed in renaming index. */
......
......@@ -427,7 +427,7 @@ row_undo_mod_del_unmark_sec_and_undo_update(
mtr_start(&mtr);
/* 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);
}
......
......@@ -453,12 +453,13 @@ ut_print_namel(
#ifdef UNIV_HOTBACKUP
fwrite(name, 1, namelen, f);
#else
char* slash = memchr(name, '/', namelen);
if (table_id) {
char* slash;
if (UNIV_UNLIKELY(*name == TEMP_TABLE_PREFIX)) {
slash = memchr(name + 1, '/', namelen);
if (UNIV_LIKELY(slash && slash >= name + 2)) {
ut_ad(table_id);
if (UNIV_UNLIKELY(*name == TEMP_TABLE_PREFIX)) {
slash = memchr(name + 1, '/', namelen);
ut_ad(slash && slash >= name + 2);
/* Database */
innobase_print_identifier(f, trx, TRUE, name + 2,
......@@ -470,23 +471,29 @@ ut_print_namel(
- (slash - (name + 3)));
/* Identifier of temporary table */
fprintf(f, "--temporary %c--", name[1]);
} else {
ut_ad(!table_id);
return;
}
slash = memchr(name, '/', namelen);
/* Temporary index */
innobase_print_identifier(f, trx, table_id, name + 1,
namelen - 1);
fputs("--temporary--", f);
if (!slash) {
goto no_db_name;
}
} else if (UNIV_LIKELY_NULL(slash)) {
/* Print the database name and table name separately. */
ut_ad(table_id);
innobase_print_identifier(f, trx, TRUE, name, slash - name);
putc('.', f);
innobase_print_identifier(f, trx, TRUE, slash + 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 {
no_db_name:
innobase_print_identifier(f, trx, table_id, name, namelen);
}
#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