Merge from mysql-5.1-innodb.
This commit is contained in:
commit
f36fb62bad
@ -2010,7 +2010,7 @@ row_merge_drop_index(
|
|||||||
tables in Innobase. Deleting a row from SYS_INDEXES table also
|
tables in Innobase. Deleting a row from SYS_INDEXES table also
|
||||||
frees the file segments of the B-tree associated with the index. */
|
frees the file segments of the B-tree associated with the index. */
|
||||||
|
|
||||||
static const char str1[] =
|
static const char sql[] =
|
||||||
"PROCEDURE DROP_INDEX_PROC () IS\n"
|
"PROCEDURE DROP_INDEX_PROC () IS\n"
|
||||||
"BEGIN\n"
|
"BEGIN\n"
|
||||||
/* Rename the index, so that it will be dropped by
|
/* Rename the index, so that it will be dropped by
|
||||||
@ -2034,9 +2034,19 @@ row_merge_drop_index(
|
|||||||
|
|
||||||
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
|
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
|
||||||
|
|
||||||
err = que_eval_sql(info, str1, FALSE, trx);
|
err = que_eval_sql(info, sql, FALSE, trx);
|
||||||
|
|
||||||
ut_a(err == DB_SUCCESS);
|
|
||||||
|
if (err != DB_SUCCESS) {
|
||||||
|
/* Even though we ensure that DDL transactions are WAIT
|
||||||
|
and DEADLOCK free, we could encounter other errors e.g.,
|
||||||
|
DB_TOO_MANY_TRANSACTIONS. */
|
||||||
|
trx->error_state = DB_SUCCESS;
|
||||||
|
|
||||||
|
ut_print_timestamp(stderr);
|
||||||
|
fprintf(stderr, " InnoDB: Error: row_merge_drop_index failed "
|
||||||
|
"with error code: %lu.\n", (ulint) err);
|
||||||
|
}
|
||||||
|
|
||||||
/* Replace this index with another equivalent index for all
|
/* Replace this index with another equivalent index for all
|
||||||
foreign key constraints on this table where this index is used */
|
foreign key constraints on this table where this index is used */
|
||||||
@ -2336,7 +2346,7 @@ row_merge_rename_indexes(
|
|||||||
/* 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 indexes. */
|
query graphs needed in renaming indexes. */
|
||||||
|
|
||||||
static const char rename_indexes[] =
|
static const char sql[] =
|
||||||
"PROCEDURE RENAME_INDEXES_PROC () IS\n"
|
"PROCEDURE RENAME_INDEXES_PROC () IS\n"
|
||||||
"BEGIN\n"
|
"BEGIN\n"
|
||||||
"UPDATE SYS_INDEXES SET NAME=SUBSTR(NAME,1,LENGTH(NAME)-1)\n"
|
"UPDATE SYS_INDEXES SET NAME=SUBSTR(NAME,1,LENGTH(NAME)-1)\n"
|
||||||
@ -2352,7 +2362,7 @@ row_merge_rename_indexes(
|
|||||||
|
|
||||||
pars_info_add_ull_literal(info, "tableid", table->id);
|
pars_info_add_ull_literal(info, "tableid", table->id);
|
||||||
|
|
||||||
err = que_eval_sql(info, rename_indexes, FALSE, trx);
|
err = que_eval_sql(info, sql, FALSE, trx);
|
||||||
|
|
||||||
if (err == DB_SUCCESS) {
|
if (err == DB_SUCCESS) {
|
||||||
dict_index_t* index = dict_table_get_first_index(table);
|
dict_index_t* index = dict_table_get_first_index(table);
|
||||||
@ -2362,6 +2372,15 @@ row_merge_rename_indexes(
|
|||||||
}
|
}
|
||||||
index = dict_table_get_next_index(index);
|
index = dict_table_get_next_index(index);
|
||||||
} while (index);
|
} while (index);
|
||||||
|
} else {
|
||||||
|
/* Even though we ensure that DDL transactions are WAIT
|
||||||
|
and DEADLOCK free, we could encounter other errors e.g.,
|
||||||
|
DB_TOO_MANY_TRANSACTIONS. */
|
||||||
|
trx->error_state = DB_SUCCESS;
|
||||||
|
|
||||||
|
ut_print_timestamp(stderr);
|
||||||
|
fprintf(stderr, " InnoDB: Error: row_merge_rename_indexes "
|
||||||
|
"failed with error code: %lu.\n", (ulint) err);
|
||||||
}
|
}
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = "";
|
||||||
@ -2399,7 +2418,7 @@ row_merge_rename_tables(
|
|||||||
memcpy(old_name, old_table->name, strlen(old_table->name) + 1);
|
memcpy(old_name, old_table->name, strlen(old_table->name) + 1);
|
||||||
} else {
|
} else {
|
||||||
ut_print_timestamp(stderr);
|
ut_print_timestamp(stderr);
|
||||||
fprintf(stderr, "InnoDB: too long table name: '%s', "
|
fprintf(stderr, " InnoDB: too long table name: '%s', "
|
||||||
"max length is %d\n", old_table->name,
|
"max length is %d\n", old_table->name,
|
||||||
MAX_FULL_NAME_LEN);
|
MAX_FULL_NAME_LEN);
|
||||||
ut_error;
|
ut_error;
|
||||||
|
@ -1065,6 +1065,8 @@ trx_commit_off_kernel(
|
|||||||
ut_ad(UT_LIST_GET_LEN(trx->trx_locks) == 0);
|
ut_ad(UT_LIST_GET_LEN(trx->trx_locks) == 0);
|
||||||
|
|
||||||
UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
|
UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
|
||||||
|
|
||||||
|
trx->error_state = DB_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************//**
|
/****************************************************************//**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user