mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
XtraDB-5.6.23-72.1
This commit is contained in:
commit
bbcc8e6924
30 changed files with 273 additions and 86 deletions
|
@ -2522,15 +2522,15 @@ btr_cur_pess_upd_restore_supremum(
|
|||
Check if the total length of the modified blob for the row is within 10%
|
||||
of the total redo log size. This constraint on the blob length is to
|
||||
avoid overwriting the redo logs beyond the last checkpoint lsn.
|
||||
@return DB_SUCCESS or DB_TOO_BIG_RECORD. */
|
||||
@return DB_SUCCESS or DB_TOO_BIG_FOR_REDO. */
|
||||
static
|
||||
dberr_t
|
||||
btr_check_blob_limit(const big_rec_t* big_rec_vec)
|
||||
{
|
||||
const ib_uint64_t redo_size = srv_n_log_files * srv_log_file_size
|
||||
* UNIV_PAGE_SIZE;
|
||||
const ulint redo_10p = redo_size / 10;
|
||||
ulint total_blob_len = 0;
|
||||
const ib_uint64_t redo_10p = redo_size / 10;
|
||||
ib_uint64_t total_blob_len = 0;
|
||||
dberr_t err = DB_SUCCESS;
|
||||
|
||||
/* Calculate the total number of bytes for blob data */
|
||||
|
@ -2540,11 +2540,11 @@ btr_check_blob_limit(const big_rec_t* big_rec_vec)
|
|||
|
||||
if (total_blob_len > redo_10p) {
|
||||
ib_logf(IB_LOG_LEVEL_ERROR, "The total blob data"
|
||||
" length (" ULINTPF ") is greater than"
|
||||
" length (" UINT64PF ") is greater than"
|
||||
" 10%% of the total redo log size (" UINT64PF
|
||||
"). Please increase total redo log size.",
|
||||
total_blob_len, redo_size);
|
||||
err = DB_TOO_BIG_RECORD;
|
||||
err = DB_TOO_BIG_FOR_REDO;
|
||||
}
|
||||
|
||||
return(err);
|
||||
|
@ -4659,7 +4659,7 @@ Stores the fields in big_rec_vec to the tablespace and puts pointers to
|
|||
them in rec. The extern flags in rec will have to be set beforehand.
|
||||
The fields are stored on pages allocated from leaf node
|
||||
file segment of the index tree.
|
||||
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
|
||||
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE or DB_TOO_BIG_FOR_REDO */
|
||||
UNIV_INTERN
|
||||
dberr_t
|
||||
btr_store_big_rec_extern_fields(
|
||||
|
|
|
@ -2461,10 +2461,10 @@ too_big:
|
|||
dict_mem_index_free(new_index);
|
||||
dict_mem_index_free(index);
|
||||
return(DB_TOO_BIG_RECORD);
|
||||
} else {
|
||||
|
||||
} else if (current_thd != NULL) {
|
||||
/* Avoid the warning to be printed
|
||||
during recovery. */
|
||||
ib_warn_row_too_big(table);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -335,6 +335,9 @@ dict_mem_table_col_rename_low(
|
|||
ut_ad(from_len <= NAME_LEN);
|
||||
ut_ad(to_len <= NAME_LEN);
|
||||
|
||||
char from[NAME_LEN];
|
||||
strncpy(from, s, NAME_LEN);
|
||||
|
||||
if (from_len == to_len) {
|
||||
/* The easy case: simply replace the column name in
|
||||
table->col_names. */
|
||||
|
@ -402,14 +405,53 @@ dict_mem_table_col_rename_low(
|
|||
|
||||
foreign = *it;
|
||||
|
||||
for (unsigned f = 0; f < foreign->n_fields; f++) {
|
||||
/* These can point straight to
|
||||
table->col_names, because the foreign key
|
||||
constraints will be freed at the same time
|
||||
when the table object is freed. */
|
||||
foreign->foreign_col_names[f]
|
||||
= dict_index_get_nth_field(
|
||||
foreign->foreign_index, f)->name;
|
||||
if (foreign->foreign_index == NULL) {
|
||||
/* We may go here when we set foreign_key_checks to 0,
|
||||
and then try to rename a column and modify the
|
||||
corresponding foreign key constraint. The index
|
||||
would have been dropped, we have to find an equivalent
|
||||
one */
|
||||
for (unsigned f = 0; f < foreign->n_fields; f++) {
|
||||
if (strcmp(foreign->foreign_col_names[f], from)
|
||||
== 0) {
|
||||
|
||||
char** rc = const_cast<char**>(
|
||||
foreign->foreign_col_names
|
||||
+ f);
|
||||
|
||||
if (to_len <= strlen(*rc)) {
|
||||
memcpy(*rc, to, to_len + 1);
|
||||
} else {
|
||||
*rc = static_cast<char*>(
|
||||
mem_heap_dup(
|
||||
foreign->heap,
|
||||
to,
|
||||
to_len + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dict_index_t* new_index = dict_foreign_find_index(
|
||||
foreign->foreign_table, NULL,
|
||||
foreign->foreign_col_names,
|
||||
foreign->n_fields, NULL, true, false);
|
||||
/* There must be an equivalent index in this case. */
|
||||
ut_ad(new_index != NULL);
|
||||
|
||||
foreign->foreign_index = new_index;
|
||||
|
||||
} else {
|
||||
|
||||
for (unsigned f = 0; f < foreign->n_fields; f++) {
|
||||
/* These can point straight to
|
||||
table->col_names, because the foreign key
|
||||
constraints will be freed at the same time
|
||||
when the table object is freed. */
|
||||
foreign->foreign_col_names[f]
|
||||
= dict_index_get_nth_field(
|
||||
foreign->foreign_index,
|
||||
f)->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -419,6 +461,8 @@ dict_mem_table_col_rename_low(
|
|||
|
||||
foreign = *it;
|
||||
|
||||
ut_ad(foreign->referenced_index != NULL);
|
||||
|
||||
for (unsigned f = 0; f < foreign->n_fields; f++) {
|
||||
/* foreign->referenced_col_names[] need to be
|
||||
copies, because the constraint may become
|
||||
|
|
|
@ -694,3 +694,51 @@ fts_ast_string_print(
|
|||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
const char*
|
||||
fts_ast_oper_name_get(fts_ast_oper_t oper)
|
||||
{
|
||||
switch(oper) {
|
||||
case FTS_NONE:
|
||||
return("FTS_NONE");
|
||||
case FTS_IGNORE:
|
||||
return("FTS_IGNORE");
|
||||
case FTS_EXIST:
|
||||
return("FTS_EXIST");
|
||||
case FTS_NEGATE:
|
||||
return("FTS_NEGATE");
|
||||
case FTS_INCR_RATING:
|
||||
return("FTS_INCR_RATING");
|
||||
case FTS_DECR_RATING:
|
||||
return("FTS_DECR_RATING");
|
||||
case FTS_DISTANCE:
|
||||
return("FTS_DISTANCE");
|
||||
case FTS_IGNORE_SKIP:
|
||||
return("FTS_IGNORE_SKIP");
|
||||
case FTS_EXIST_SKIP:
|
||||
return("FTS_EXIST_SKIP");
|
||||
}
|
||||
ut_ad(0);
|
||||
}
|
||||
|
||||
const char*
|
||||
fts_ast_node_type_get(fts_ast_type_t type)
|
||||
{
|
||||
switch (type) {
|
||||
case FTS_AST_OPER:
|
||||
return("FTS_AST_OPER");
|
||||
case FTS_AST_NUMB:
|
||||
return("FTS_AST_NUMB");
|
||||
case FTS_AST_TERM:
|
||||
return("FTS_AST_TERM");
|
||||
case FTS_AST_TEXT:
|
||||
return("FTS_AST_TEXT");
|
||||
case FTS_AST_LIST:
|
||||
return("FTS_AST_LIST");
|
||||
case FTS_AST_SUBEXP_LIST:
|
||||
return("FTS_AST_SUBEXP_LIST");
|
||||
}
|
||||
ut_ad(0);
|
||||
}
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
|
|
@ -2577,8 +2577,6 @@ fts_optimize_add_table(
|
|||
return;
|
||||
}
|
||||
|
||||
ut_ad(table->cached && table->fts != NULL);
|
||||
|
||||
/* Make sure table with FTS index cannot be evicted */
|
||||
if (table->can_be_evicted) {
|
||||
dict_table_move_from_lru_to_non_lru(table);
|
||||
|
|
|
@ -1534,7 +1534,8 @@ fts_merge_doc_ids(
|
|||
{
|
||||
const ib_rbt_node_t* node;
|
||||
|
||||
ut_a(!rbt_empty(doc_ids));
|
||||
DBUG_ENTER("fts_merge_doc_ids");
|
||||
|
||||
ut_a(!query->intersection);
|
||||
|
||||
/* To process FTS_EXIST operation (intersection), we need
|
||||
|
@ -1559,7 +1560,7 @@ fts_merge_doc_ids(
|
|||
query, ranking->doc_id, ranking->rank);
|
||||
|
||||
if (query->error != DB_SUCCESS) {
|
||||
return(query->error);
|
||||
DBUG_RETURN(query->error);
|
||||
}
|
||||
|
||||
/* Merge words. Don't need to take operator into account. */
|
||||
|
@ -1578,7 +1579,7 @@ fts_merge_doc_ids(
|
|||
query->intersection = NULL;
|
||||
}
|
||||
|
||||
return(DB_SUCCESS);
|
||||
DBUG_RETURN(DB_SUCCESS);
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
|
@ -2839,11 +2840,11 @@ fts_query_visitor(
|
|||
fts_query_t* query = static_cast<fts_query_t*>(arg);
|
||||
|
||||
ut_a(node);
|
||||
DBUG_ENTER("fts_query_visitor");
|
||||
DBUG_PRINT("fts", ("nodetype: %s", fts_ast_node_type_get(node->type)));
|
||||
|
||||
token.f_n_char = 0;
|
||||
|
||||
query->oper = oper;
|
||||
|
||||
query->cur_node = node;
|
||||
|
||||
switch (node->type) {
|
||||
|
@ -2905,7 +2906,7 @@ fts_query_visitor(
|
|||
query->multi_exist = true;
|
||||
}
|
||||
|
||||
return(query->error);
|
||||
DBUG_RETURN(query->error);
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
|
@ -2929,6 +2930,8 @@ fts_ast_visit_sub_exp(
|
|||
bool will_be_ignored = false;
|
||||
bool multi_exist;
|
||||
|
||||
DBUG_ENTER("fts_ast_visit_sub_exp");
|
||||
|
||||
ut_a(node->type == FTS_AST_SUBEXP_LIST);
|
||||
|
||||
cur_oper = query->oper;
|
||||
|
@ -2957,14 +2960,14 @@ fts_ast_visit_sub_exp(
|
|||
/* Merge the sub-expression result with the parent result set. */
|
||||
subexpr_doc_ids = query->doc_ids;
|
||||
query->doc_ids = parent_doc_ids;
|
||||
if (error == DB_SUCCESS && !rbt_empty(subexpr_doc_ids)) {
|
||||
if (error == DB_SUCCESS) {
|
||||
error = fts_merge_doc_ids(query, subexpr_doc_ids);
|
||||
}
|
||||
|
||||
/* Free current result set. Result already merged into parent. */
|
||||
fts_query_free_doc_ids(query, subexpr_doc_ids);
|
||||
|
||||
return(error);
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -3440,8 +3443,10 @@ fts_retrieve_ranking(
|
|||
ib_rbt_bound_t parent;
|
||||
fts_ranking_t new_ranking;
|
||||
|
||||
DBUG_ENTER("fts_retrieve_ranking");
|
||||
|
||||
if (!result || !result->rankings_by_id) {
|
||||
return(0);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
new_ranking.doc_id = doc_id;
|
||||
|
@ -3452,10 +3457,10 @@ fts_retrieve_ranking(
|
|||
|
||||
ranking = rbt_value(fts_ranking_t, parent.last);
|
||||
|
||||
return(ranking->rank);
|
||||
DBUG_RETURN(ranking->rank);
|
||||
}
|
||||
|
||||
return(0);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
|
@ -3472,6 +3477,8 @@ fts_query_prepare_result(
|
|||
const ib_rbt_node_t* node;
|
||||
bool result_is_null = false;
|
||||
|
||||
DBUG_ENTER("fts_query_prepare_result");
|
||||
|
||||
if (result == NULL) {
|
||||
result = static_cast<fts_result_t*>(ut_malloc(sizeof(*result)));
|
||||
|
||||
|
@ -3520,7 +3527,7 @@ fts_query_prepare_result(
|
|||
if (query->total_size > fts_result_cache_limit) {
|
||||
query->error = DB_FTS_EXCEED_RESULT_CACHE_LIMIT;
|
||||
fts_query_free_result(result);
|
||||
return(NULL);
|
||||
DBUG_RETURN(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3543,7 +3550,7 @@ fts_query_prepare_result(
|
|||
ranking->rank * word_freq->idf * word_freq->idf);
|
||||
}
|
||||
|
||||
return(result);
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
|
||||
ut_a(rbt_size(query->doc_ids) > 0);
|
||||
|
@ -3570,7 +3577,7 @@ fts_query_prepare_result(
|
|||
if (query->total_size > fts_result_cache_limit) {
|
||||
query->error = DB_FTS_EXCEED_RESULT_CACHE_LIMIT;
|
||||
fts_query_free_result(result);
|
||||
return(NULL);
|
||||
DBUG_RETURN(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3582,7 +3589,7 @@ fts_query_prepare_result(
|
|||
query->doc_ids = NULL;
|
||||
}
|
||||
|
||||
return(result);
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
|
@ -3594,6 +3601,8 @@ fts_query_get_result(
|
|||
fts_query_t* query, /*!< in: query instance */
|
||||
fts_result_t* result) /*!< in: result */
|
||||
{
|
||||
DBUG_ENTER("fts_query_get_result");
|
||||
|
||||
if (rbt_size(query->doc_ids) > 0 || query->flags == FTS_OPT_RANKING) {
|
||||
/* Copy the doc ids to the result. */
|
||||
result = fts_query_prepare_result(query, result);
|
||||
|
@ -3603,7 +3612,7 @@ fts_query_get_result(
|
|||
memset(result, 0, sizeof(*result));
|
||||
}
|
||||
|
||||
return(result);
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
|
@ -3681,6 +3690,7 @@ fts_query_parse(
|
|||
int error;
|
||||
fts_ast_state_t state;
|
||||
bool mode = query->boolean_mode;
|
||||
DBUG_ENTER("fts_query_parse");
|
||||
|
||||
memset(&state, 0x0, sizeof(state));
|
||||
|
||||
|
@ -3699,7 +3709,7 @@ fts_query_parse(
|
|||
query->root = state.root;
|
||||
}
|
||||
|
||||
return(state.root);
|
||||
DBUG_RETURN(state.root);
|
||||
}
|
||||
|
||||
/*******************************************************************//**
|
||||
|
|
|
@ -1807,6 +1807,15 @@ convert_error_code_to_mysql(
|
|||
return(HA_ERR_TO_BIG_ROW);
|
||||
}
|
||||
|
||||
|
||||
case DB_TOO_BIG_FOR_REDO:
|
||||
my_printf_error(ER_TOO_BIG_ROWSIZE, "%s" , MYF(0),
|
||||
"The size of BLOB/TEXT data inserted"
|
||||
" in one transaction is greater than"
|
||||
" 10% of redo log size. Increase the"
|
||||
" redo log size using innodb_log_file_size.");
|
||||
return(HA_ERR_TO_BIG_ROW);
|
||||
|
||||
case DB_TOO_BIG_INDEX_COL:
|
||||
my_error(ER_INDEX_COLUMN_TOO_LONG, MYF(0),
|
||||
DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags));
|
||||
|
@ -14564,10 +14573,8 @@ ha_innobase::cmp_ref(
|
|||
len1 = innobase_read_from_2_little_endian(ref1);
|
||||
len2 = innobase_read_from_2_little_endian(ref2);
|
||||
|
||||
ref1 += 2;
|
||||
ref2 += 2;
|
||||
result = ((Field_blob*) field)->cmp(
|
||||
ref1, len1, ref2, len2);
|
||||
ref1 + 2, len1, ref2 + 2, len2);
|
||||
} else {
|
||||
result = field->key_cmp(ref1, ref2);
|
||||
}
|
||||
|
|
|
@ -4458,11 +4458,15 @@ err_exit:
|
|||
rename_foreign:
|
||||
trx->op_info = "renaming column in SYS_FOREIGN_COLS";
|
||||
|
||||
std::list<dict_foreign_t*> fk_evict;
|
||||
bool foreign_modified;
|
||||
|
||||
for (dict_foreign_set::const_iterator it = user_table->foreign_set.begin();
|
||||
it != user_table->foreign_set.end();
|
||||
++it) {
|
||||
|
||||
dict_foreign_t* foreign = *it;
|
||||
foreign_modified = false;
|
||||
|
||||
for (unsigned i = 0; i < foreign->n_fields; i++) {
|
||||
if (strcmp(foreign->foreign_col_names[i], from)) {
|
||||
|
@ -4490,6 +4494,11 @@ rename_foreign:
|
|||
if (error != DB_SUCCESS) {
|
||||
goto err_exit;
|
||||
}
|
||||
foreign_modified = true;
|
||||
}
|
||||
|
||||
if (foreign_modified) {
|
||||
fk_evict.push_back(foreign);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4498,7 +4507,9 @@ rename_foreign:
|
|||
it != user_table->referenced_set.end();
|
||||
++it) {
|
||||
|
||||
foreign_modified = false;
|
||||
dict_foreign_t* foreign = *it;
|
||||
|
||||
for (unsigned i = 0; i < foreign->n_fields; i++) {
|
||||
if (strcmp(foreign->referenced_col_names[i], from)) {
|
||||
continue;
|
||||
|
@ -4525,7 +4536,17 @@ rename_foreign:
|
|||
if (error != DB_SUCCESS) {
|
||||
goto err_exit;
|
||||
}
|
||||
foreign_modified = true;
|
||||
}
|
||||
|
||||
if (foreign_modified) {
|
||||
fk_evict.push_back(foreign);
|
||||
}
|
||||
}
|
||||
|
||||
if (new_clustered) {
|
||||
std::for_each(fk_evict.begin(), fk_evict.end(),
|
||||
dict_foreign_remove_from_cache);
|
||||
}
|
||||
|
||||
trx->op_info = "";
|
||||
|
|
|
@ -3937,7 +3937,7 @@ check_watch:
|
|||
{
|
||||
buf_page_t* bpage;
|
||||
buf_pool_t* buf_pool = buf_pool_get(space, page_no);
|
||||
bpage = buf_page_hash_get(buf_pool, space, page_no);
|
||||
bpage = buf_page_get_also_watch(buf_pool, space, page_no);
|
||||
|
||||
if (UNIV_LIKELY_NULL(bpage)) {
|
||||
/* A buffer pool watch has been set or the
|
||||
|
|
|
@ -1282,7 +1282,7 @@ page_hash lock is acquired in the specified lock mode. Otherwise,
|
|||
mode value is ignored. It is up to the caller to release the
|
||||
lock. If the block is found and the lock is NULL then the page_hash
|
||||
lock is released by this function.
|
||||
@return block, NULL if not found */
|
||||
@return block, NULL if not found, or watch sentinel (if watch is true) */
|
||||
UNIV_INLINE
|
||||
buf_page_t*
|
||||
buf_page_hash_get_locked(
|
||||
|
@ -1298,9 +1298,11 @@ buf_page_hash_get_locked(
|
|||
found. NULL otherwise. If NULL
|
||||
is passed then the hash_lock
|
||||
is released by this function */
|
||||
ulint lock_mode); /*!< in: RW_LOCK_EX or
|
||||
ulint lock_mode, /*!< in: RW_LOCK_EX or
|
||||
RW_LOCK_SHARED. Ignored if
|
||||
lock == NULL */
|
||||
bool watch = false); /*!< in: if true, return watch
|
||||
sentinel also. */
|
||||
/******************************************************************//**
|
||||
Returns the control block of a file page, NULL if not found.
|
||||
If the block is found and lock is not NULL then the appropriate
|
||||
|
@ -1340,6 +1342,8 @@ buf_page_hash_get_low() function.
|
|||
buf_page_hash_get_locked(b, s, o, l, RW_LOCK_EX)
|
||||
#define buf_page_hash_get(b, s, o) \
|
||||
buf_page_hash_get_locked(b, s, o, NULL, 0)
|
||||
#define buf_page_get_also_watch(b, s, o) \
|
||||
buf_page_hash_get_locked(b, s, o, NULL, 0, true)
|
||||
|
||||
#define buf_block_hash_get_s_locked(b, s, o, l) \
|
||||
buf_block_hash_get_locked(b, s, o, l, RW_LOCK_SHARED)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2008, Google Inc.
|
||||
|
||||
Portions of this file contain modifications contributed and copyrighted by
|
||||
|
@ -1193,7 +1193,7 @@ page_hash lock is acquired in the specified lock mode. Otherwise,
|
|||
mode value is ignored. It is up to the caller to release the
|
||||
lock. If the block is found and the lock is NULL then the page_hash
|
||||
lock is released by this function.
|
||||
@return block, NULL if not found */
|
||||
@return block, NULL if not found, or watch sentinel (if watch is true) */
|
||||
UNIV_INLINE
|
||||
buf_page_t*
|
||||
buf_page_hash_get_locked(
|
||||
|
@ -1209,9 +1209,11 @@ buf_page_hash_get_locked(
|
|||
found. NULL otherwise. If NULL
|
||||
is passed then the hash_lock
|
||||
is released by this function */
|
||||
ulint lock_mode) /*!< in: RW_LOCK_EX or
|
||||
ulint lock_mode, /*!< in: RW_LOCK_EX or
|
||||
RW_LOCK_SHARED. Ignored if
|
||||
lock == NULL */
|
||||
bool watch) /*!< in: if true, return watch
|
||||
sentinel also. */
|
||||
{
|
||||
buf_page_t* bpage = NULL;
|
||||
ulint fold;
|
||||
|
@ -1242,7 +1244,9 @@ buf_page_hash_get_locked(
|
|||
bpage = buf_page_hash_get_low(buf_pool, space, offset, fold);
|
||||
|
||||
if (!bpage || buf_pool_watch_is_sentinel(buf_pool, bpage)) {
|
||||
bpage = NULL;
|
||||
if (!watch) {
|
||||
bpage = NULL;
|
||||
}
|
||||
goto unlock_and_exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
@ -130,7 +130,8 @@ enum dberr_t {
|
|||
DB_TEMP_FILE_WRITE_FAILURE, /*!< Temp file write failure */
|
||||
DB_FTS_TOO_MANY_WORDS_IN_PHRASE,
|
||||
/*< Too many words in a phrase */
|
||||
|
||||
DB_TOO_BIG_FOR_REDO, /* Record length greater than 10%
|
||||
of redo log */
|
||||
/* The following are partial failure codes */
|
||||
DB_FAIL = 1000,
|
||||
DB_OVERFLOW,
|
||||
|
|
|
@ -329,4 +329,11 @@ struct fts_ast_state_t {
|
|||
tokenization */
|
||||
};
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
const char*
|
||||
fts_ast_oper_name_get(fts_ast_oper_t oper);
|
||||
const char*
|
||||
fts_ast_node_type_get(fts_ast_type_t type);
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
#endif /* INNOBASE_FSTS0AST_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2006, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2006, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***********************************************************************
|
||||
|
||||
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2009, Percona Inc.
|
||||
|
||||
Portions of this file contain modifications contributed and copyrighted
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
@ -33,6 +33,8 @@ Created 3/26/1996 Heikki Tuuri
|
|||
#include "mtr0mtr.h"
|
||||
#include "trx0sys.h"
|
||||
|
||||
extern bool trx_rollback_or_clean_is_active;
|
||||
|
||||
/*******************************************************************//**
|
||||
Determines if this transaction is rolling back an incomplete transaction
|
||||
in crash recovery.
|
||||
|
|
|
@ -44,10 +44,10 @@ Created 1/20/1994 Heikki Tuuri
|
|||
|
||||
#define INNODB_VERSION_MAJOR 5
|
||||
#define INNODB_VERSION_MINOR 6
|
||||
#define INNODB_VERSION_BUGFIX 22
|
||||
#define INNODB_VERSION_BUGFIX 23
|
||||
|
||||
#ifndef PERCONA_INNODB_VERSION
|
||||
#define PERCONA_INNODB_VERSION 72.0
|
||||
#define PERCONA_INNODB_VERSION 72.1
|
||||
#endif
|
||||
|
||||
/* Enable UNIV_LOG_ARCHIVE in XtraDB */
|
||||
|
|
|
@ -2093,7 +2093,8 @@ lock_rec_add_to_queue(
|
|||
|
||||
ut_ad(lock_mutex_own());
|
||||
ut_ad(caller_owns_trx_mutex == trx_mutex_own(trx));
|
||||
ut_ad(dict_index_is_clust(index) || !dict_index_is_online_ddl(index));
|
||||
ut_ad(dict_index_is_clust(index)
|
||||
|| dict_index_get_online_status(index) != ONLINE_INDEX_CREATION);
|
||||
#ifdef UNIV_DEBUG
|
||||
switch (type_mode & LOCK_MODE_MASK) {
|
||||
case LOCK_X:
|
||||
|
@ -5549,7 +5550,7 @@ loop:
|
|||
}
|
||||
}
|
||||
|
||||
if (!srv_print_innodb_lock_monitor && !srv_show_locks_held) {
|
||||
if (!srv_print_innodb_lock_monitor || !srv_show_locks_held) {
|
||||
nth_trx++;
|
||||
goto loop;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2009, Google Inc.
|
||||
|
||||
Portions of this file contain modifications contributed and copyrighted by
|
||||
|
@ -55,6 +55,7 @@ Created 12/9/1995 Heikki Tuuri
|
|||
#include "srv0start.h"
|
||||
#include "trx0sys.h"
|
||||
#include "trx0trx.h"
|
||||
#include "trx0roll.h"
|
||||
#include "srv0mon.h"
|
||||
|
||||
/*
|
||||
|
@ -3514,6 +3515,12 @@ logs_empty_and_mark_files_at_shutdown(void)
|
|||
if (log_disable_checkpoint_active)
|
||||
log_enable_checkpoint();
|
||||
|
||||
while (srv_fast_shutdown == 0 && trx_rollback_or_clean_is_active) {
|
||||
/* we should wait until rollback after recovery end
|
||||
for slow shutdown */
|
||||
os_thread_sleep(100000);
|
||||
}
|
||||
|
||||
/* Wait until the master thread and all other operations are idle: our
|
||||
algorithm only works if the server is idle at shutdown */
|
||||
|
||||
|
|
|
@ -3580,6 +3580,7 @@ recv_recovery_rollback_active(void)
|
|||
/* Rollback the uncommitted transactions which have no user
|
||||
session */
|
||||
|
||||
trx_rollback_or_clean_is_active = true;
|
||||
os_thread_create(trx_rollback_or_clean_all_recovered, 0, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***********************************************************************
|
||||
|
||||
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2009, Percona Inc.
|
||||
|
||||
Portions of this file contain modifications contributed and copyrighted
|
||||
|
@ -2888,13 +2888,18 @@ try_again:
|
|||
ret = os_file_pread(file, buf, n, offset, trx);
|
||||
|
||||
if ((ulint) ret == n) {
|
||||
|
||||
return(TRUE);
|
||||
} else if (ret == -1) {
|
||||
ib_logf(IB_LOG_LEVEL_ERROR,
|
||||
"Error in system call pread(). The operating"
|
||||
" system error number is %lu.",(ulint) errno);
|
||||
} else {
|
||||
/* Partial read occured */
|
||||
ib_logf(IB_LOG_LEVEL_ERROR,
|
||||
"Tried to read " ULINTPF " bytes at offset "
|
||||
UINT64PF ". Was only able to read %ld.",
|
||||
n, offset, (lint) ret);
|
||||
}
|
||||
|
||||
ib_logf(IB_LOG_LEVEL_ERROR,
|
||||
"Tried to read " ULINTPF " bytes at offset " UINT64PF ". "
|
||||
"Was only able to read %ld.", n, offset, (lint) ret);
|
||||
#endif /* __WIN__ */
|
||||
retry = os_file_handle_error(NULL, "read");
|
||||
|
||||
|
@ -2987,8 +2992,17 @@ try_again:
|
|||
ret = os_file_pread(file, buf, n, offset, NULL);
|
||||
|
||||
if ((ulint) ret == n) {
|
||||
|
||||
return(TRUE);
|
||||
} else if (ret == -1) {
|
||||
ib_logf(IB_LOG_LEVEL_ERROR,
|
||||
"Error in system call pread(). The operating"
|
||||
" system error number is %lu.",(ulint) errno);
|
||||
} else {
|
||||
/* Partial read occured */
|
||||
ib_logf(IB_LOG_LEVEL_ERROR,
|
||||
"Tried to read " ULINTPF " bytes at offset "
|
||||
UINT64PF ". Was only able to read %ld.",
|
||||
n, offset, (lint) ret);
|
||||
}
|
||||
#endif /* __WIN__ */
|
||||
retry = os_file_handle_error_no_exit(NULL, "read", FALSE);
|
||||
|
@ -3168,18 +3182,26 @@ retry:
|
|||
|
||||
ut_print_timestamp(stderr);
|
||||
|
||||
fprintf(stderr,
|
||||
" InnoDB: Error: Write to file %s failed"
|
||||
" at offset " UINT64PF ".\n"
|
||||
"InnoDB: %lu bytes should have been written,"
|
||||
" only %ld were written.\n"
|
||||
"InnoDB: Operating system error number %lu.\n"
|
||||
"InnoDB: Check that your OS and file system"
|
||||
" support files of this size.\n"
|
||||
"InnoDB: Check also that the disk is not full"
|
||||
" or a disk quota exceeded.\n",
|
||||
name, offset, n, (lint) ret,
|
||||
(ulint) errno);
|
||||
if(ret == -1) {
|
||||
ib_logf(IB_LOG_LEVEL_ERROR,
|
||||
"Failure of system call pwrite(). Operating"
|
||||
" system error number is %lu.",
|
||||
(ulint) errno);
|
||||
} else {
|
||||
fprintf(stderr,
|
||||
" InnoDB: Error: Write to file %s failed"
|
||||
" at offset " UINT64PF ".\n"
|
||||
"InnoDB: %lu bytes should have been written,"
|
||||
" only %ld were written.\n"
|
||||
"InnoDB: Operating system error number %lu.\n"
|
||||
"InnoDB: Check that your OS and file system"
|
||||
" support files of this size.\n"
|
||||
"InnoDB: Check also that the disk is not full"
|
||||
" or a disk quota exceeded.\n",
|
||||
name, offset, n, (lint) ret,
|
||||
(ulint) errno);
|
||||
}
|
||||
|
||||
if (strerror(errno) != NULL) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error number %d means '%s'.\n",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2010, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All Rights Reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
@ -609,6 +609,7 @@ handle_new_error:
|
|||
case DB_DUPLICATE_KEY:
|
||||
case DB_FOREIGN_DUPLICATE_KEY:
|
||||
case DB_TOO_BIG_RECORD:
|
||||
case DB_TOO_BIG_FOR_REDO:
|
||||
case DB_UNDO_RECORD_TOO_BIG:
|
||||
case DB_ROW_IS_REFERENCED:
|
||||
case DB_NO_REFERENCED_ROW:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2012, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
@ -680,7 +680,6 @@ row_quiesce_set_state(
|
|||
|
||||
switch (state) {
|
||||
case QUIESCE_START:
|
||||
ut_a(table->quiesce == QUIESCE_NONE);
|
||||
break;
|
||||
|
||||
case QUIESCE_COMPLETE:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2010, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2012, Facebook Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
|
@ -925,7 +925,8 @@ static monitor_info_t innodb_counter_info[] =
|
|||
|
||||
{"adaptive_hash_searches_btree", "adaptive_hash_index",
|
||||
"Number of searches using B-tree on an index search",
|
||||
MONITOR_NONE,
|
||||
static_cast<monitor_type_t>(
|
||||
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
|
||||
MONITOR_DEFAULT_START, MONITOR_OVLD_ADAPTIVE_HASH_SEARCH_BTREE},
|
||||
|
||||
{"adaptive_hash_pages_added", "adaptive_hash_index",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2008, 2009 Google Inc.
|
||||
Copyright (c) 2009, Percona Inc.
|
||||
Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
|
||||
|
@ -3285,7 +3285,9 @@ srv_do_purge(
|
|||
|
||||
*n_total_purged += n_pages_purged;
|
||||
|
||||
} while (!srv_purge_should_exit(n_pages_purged) && n_pages_purged > 0);
|
||||
} while (!srv_purge_should_exit(n_pages_purged)
|
||||
&& n_pages_purged > 0
|
||||
&& purge_sys->state == PURGE_STATE_RUN);
|
||||
|
||||
return(rseg_history_len);
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@ Created 3/26/1996 Heikki Tuuri
|
|||
rollback */
|
||||
#define TRX_ROLL_TRUNC_THRESHOLD 1
|
||||
|
||||
/** true if trx_rollback_or_clean_all_recovered() thread is active */
|
||||
bool trx_rollback_or_clean_is_active;
|
||||
|
||||
/** In crash recovery, the current trx to be rolled back; NULL otherwise */
|
||||
static const trx_t* trx_roll_crash_recv_trx = NULL;
|
||||
|
||||
|
@ -805,6 +808,8 @@ DECLARE_THREAD(trx_rollback_or_clean_all_recovered)(
|
|||
|
||||
trx_rollback_or_clean_recovered(TRUE);
|
||||
|
||||
trx_rollback_or_clean_is_active = false;
|
||||
|
||||
/* We count the number of threads in os_thread_exit(). A created
|
||||
thread should always use that to exit and not use return() to exit. */
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
@ -825,6 +825,8 @@ ut_strerr(
|
|||
return("Temp file write failure");
|
||||
case DB_FTS_TOO_MANY_WORDS_IN_PHRASE:
|
||||
return("Too many words in a FTS phrase or proximity search");
|
||||
case DB_TOO_BIG_FOR_REDO:
|
||||
return("BLOB record length is greater than 10%% of redo log");
|
||||
|
||||
/* do not add default: in order to produce a warning if new code
|
||||
is added to the enum but not added here */
|
||||
|
|
Loading…
Reference in a new issue