summaryrefslogtreecommitdiff
path: root/storage/xtradb
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb')
-rw-r--r--storage/xtradb/btr/btr0cur.cc12
-rw-r--r--storage/xtradb/dict/dict0dict.cc6
-rw-r--r--storage/xtradb/dict/dict0mem.cc62
-rw-r--r--storage/xtradb/fts/fts0ast.cc48
-rw-r--r--storage/xtradb/fts/fts0opt.cc2
-rw-r--r--storage/xtradb/fts/fts0que.cc44
-rw-r--r--storage/xtradb/handler/ha_innodb.cc13
-rw-r--r--storage/xtradb/handler/handler0alter.cc21
-rw-r--r--storage/xtradb/ibuf/ibuf0ibuf.cc2
-rw-r--r--storage/xtradb/include/buf0buf.h8
-rw-r--r--storage/xtradb/include/buf0buf.ic12
-rw-r--r--storage/xtradb/include/db0err.h5
-rw-r--r--storage/xtradb/include/dict0mem.h1
-rw-r--r--storage/xtradb/include/fts0ast.h7
-rw-r--r--storage/xtradb/include/ha_prototypes.h2
-rw-r--r--storage/xtradb/include/os0file.h2
-rw-r--r--storage/xtradb/include/os0sync.h2
-rw-r--r--storage/xtradb/include/row0merge.h2
-rw-r--r--storage/xtradb/include/trx0roll.h4
-rw-r--r--storage/xtradb/include/univ.i4
-rw-r--r--storage/xtradb/lock/lock0lock.cc5
-rw-r--r--storage/xtradb/log/log0log.cc9
-rw-r--r--storage/xtradb/log/log0recv.cc1
-rw-r--r--storage/xtradb/os/os0file.cc58
-rw-r--r--storage/xtradb/rem/rem0rec.cc2
-rw-r--r--storage/xtradb/row/row0ftsort.cc2
-rw-r--r--storage/xtradb/row/row0merge.cc2
-rw-r--r--storage/xtradb/row/row0mysql.cc3
-rw-r--r--storage/xtradb/row/row0quiesce.cc3
-rw-r--r--storage/xtradb/srv/srv0mon.cc5
-rw-r--r--storage/xtradb/srv/srv0srv.cc6
-rw-r--r--storage/xtradb/trx/trx0roll.cc5
-rw-r--r--storage/xtradb/ut/ut0ut.cc4
33 files changed, 276 insertions, 88 deletions
diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc
index e48e1454db4..4e5e6a713ed 100644
--- a/storage/xtradb/btr/btr0cur.cc
+++ b/storage/xtradb/btr/btr0cur.cc
@@ -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(
diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc
index fc12f1f8913..3b044c74b52 100644
--- a/storage/xtradb/dict/dict0dict.cc
+++ b/storage/xtradb/dict/dict0dict.cc
@@ -2471,10 +2471,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);
-
}
}
diff --git a/storage/xtradb/dict/dict0mem.cc b/storage/xtradb/dict/dict0mem.cc
index 3c23b55374c..43ccbdd5fe7 100644
--- a/storage/xtradb/dict/dict0mem.cc
+++ b/storage/xtradb/dict/dict0mem.cc
@@ -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
@@ -744,7 +788,7 @@ dict_foreign_set_validate(
{
dict_foreign_not_exists not_exists(fk_set);
- dict_foreign_set::iterator it = std::find_if(
+ dict_foreign_set::const_iterator it = std::find_if(
fk_set.begin(), fk_set.end(), not_exists);
if (it == fk_set.end()) {
diff --git a/storage/xtradb/fts/fts0ast.cc b/storage/xtradb/fts/fts0ast.cc
index dd48ffee14d..030b972440f 100644
--- a/storage/xtradb/fts/fts0ast.cc
+++ b/storage/xtradb/fts/fts0ast.cc
@@ -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 */
diff --git a/storage/xtradb/fts/fts0opt.cc b/storage/xtradb/fts/fts0opt.cc
index 2e2bd061d07..5891b53a6e2 100644
--- a/storage/xtradb/fts/fts0opt.cc
+++ b/storage/xtradb/fts/fts0opt.cc
@@ -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);
diff --git a/storage/xtradb/fts/fts0que.cc b/storage/xtradb/fts/fts0que.cc
index 1ca5f80b182..9d8e7aec9ab 100644
--- a/storage/xtradb/fts/fts0que.cc
+++ b/storage/xtradb/fts/fts0que.cc
@@ -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);
}
/*******************************************************************//**
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 5a2e6b7123c..23b56775786 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -2029,6 +2029,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));
@@ -16160,10 +16169,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);
}
diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index 32b1fcf4b79..4b09820d400 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -4509,11 +4509,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)) {
@@ -4541,6 +4545,11 @@ rename_foreign:
if (error != DB_SUCCESS) {
goto err_exit;
}
+ foreign_modified = true;
+ }
+
+ if (foreign_modified) {
+ fk_evict.push_back(foreign);
}
}
@@ -4549,7 +4558,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;
@@ -4576,7 +4587,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 = "";
diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc
index 0794a44cfd0..068a9fc9334 100644
--- a/storage/xtradb/ibuf/ibuf0ibuf.cc
+++ b/storage/xtradb/ibuf/ibuf0ibuf.cc
@@ -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
diff --git a/storage/xtradb/include/buf0buf.h b/storage/xtradb/include/buf0buf.h
index 912fbb9194f..b8b1d1b097c 100644
--- a/storage/xtradb/include/buf0buf.h
+++ b/storage/xtradb/include/buf0buf.h
@@ -1286,7 +1286,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(
@@ -1302,9 +1302,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
@@ -1344,6 +1346,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)
diff --git a/storage/xtradb/include/buf0buf.ic b/storage/xtradb/include/buf0buf.ic
index 8d8a314e2ef..a0bfb65a188 100644
--- a/storage/xtradb/include/buf0buf.ic
+++ b/storage/xtradb/include/buf0buf.ic
@@ -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
@@ -1211,7 +1211,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(
@@ -1227,9 +1227,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;
@@ -1260,7 +1262,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;
}
diff --git a/storage/xtradb/include/db0err.h b/storage/xtradb/include/db0err.h
index 744b80ecd05..dab917e18db 100644
--- a/storage/xtradb/include/db0err.h
+++ b/storage/xtradb/include/db0err.h
@@ -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,
diff --git a/storage/xtradb/include/dict0mem.h b/storage/xtradb/include/dict0mem.h
index b691e28f0b5..deea392f9fd 100644
--- a/storage/xtradb/include/dict0mem.h
+++ b/storage/xtradb/include/dict0mem.h
@@ -54,6 +54,7 @@ Created 1/8/1996 Heikki Tuuri
#include <set>
#include <algorithm>
#include <iterator>
+#include <ostream>
/* Forward declaration. */
struct ib_rbt_t;
diff --git a/storage/xtradb/include/fts0ast.h b/storage/xtradb/include/fts0ast.h
index 50ee587e282..b2380f78b39 100644
--- a/storage/xtradb/include/fts0ast.h
+++ b/storage/xtradb/include/fts0ast.h
@@ -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 */
diff --git a/storage/xtradb/include/ha_prototypes.h b/storage/xtradb/include/ha_prototypes.h
index f038b307a6e..22cb3eed42d 100644
--- a/storage/xtradb/include/ha_prototypes.h
+++ b/storage/xtradb/include/ha_prototypes.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
diff --git a/storage/xtradb/include/os0file.h b/storage/xtradb/include/os0file.h
index 154adf085b8..88ba7e18ac3 100644
--- a/storage/xtradb/include/os0file.h
+++ b/storage/xtradb/include/os0file.h
@@ -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.
Copyright (c) 2013, 2015, MariaDB Corporation.
diff --git a/storage/xtradb/include/os0sync.h b/storage/xtradb/include/os0sync.h
index f968de7c6dd..bd37287f1a0 100644
--- a/storage/xtradb/include/os0sync.h
+++ b/storage/xtradb/include/os0sync.h
@@ -531,7 +531,7 @@ amount of increment. */
os_atomic_increment_ulint((ulong_t*) ptr, amount)
# define os_atomic_increment_uint64(ptr, amount) \
- atomic_add_64_nv(ptr, amount)
+ atomic_add_64_nv((uint64_t *) ptr, amount)
/* Returns the resulting value, ptr is pointer to target, amount is the
amount to decrement. */
diff --git a/storage/xtradb/include/row0merge.h b/storage/xtradb/include/row0merge.h
index 1c73e38da01..f280644de70 100644
--- a/storage/xtradb/include/row0merge.h
+++ b/storage/xtradb/include/row0merge.h
@@ -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
diff --git a/storage/xtradb/include/trx0roll.h b/storage/xtradb/include/trx0roll.h
index aa3dbb1f6cd..629b41569f6 100644
--- a/storage/xtradb/include/trx0roll.h
+++ b/storage/xtradb/include/trx0roll.h
@@ -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.
diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i
index d938f27ed9b..11f9d7876f4 100644
--- a/storage/xtradb/include/univ.i
+++ b/storage/xtradb/include/univ.i
@@ -45,10 +45,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 */
diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc
index 878d7fa3ad7..59168fb741b 100644
--- a/storage/xtradb/lock/lock0lock.cc
+++ b/storage/xtradb/lock/lock0lock.cc
@@ -2333,7 +2333,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:
@@ -6019,7 +6020,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;
}
diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc
index c9aa224dc64..9a1eb1b1b28 100644
--- a/storage/xtradb/log/log0log.cc
+++ b/storage/xtradb/log/log0log.cc
@@ -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"
/*
@@ -3534,6 +3535,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 */
diff --git a/storage/xtradb/log/log0recv.cc b/storage/xtradb/log/log0recv.cc
index 79489e53809..efe3fffbfe8 100644
--- a/storage/xtradb/log/log0recv.cc
+++ b/storage/xtradb/log/log0recv.cc
@@ -3605,6 +3605,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);
}
}
diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc
index cd14e2025be..cb074cdf4f5 100644
--- a/storage/xtradb/os/os0file.cc
+++ b/storage/xtradb/os/os0file.cc
@@ -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.
Copyright (c) 2013, 2015, MariaDB Corporation.
@@ -3103,11 +3103,17 @@ try_again:
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", __FILE__, __LINE__);
@@ -3201,6 +3207,16 @@ try_again:
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, __FILE__, __LINE__);
@@ -3382,18 +3398,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",
diff --git a/storage/xtradb/rem/rem0rec.cc b/storage/xtradb/rem/rem0rec.cc
index b443e1c9dfe..4231309f10f 100644
--- a/storage/xtradb/rem/rem0rec.cc
+++ b/storage/xtradb/rem/rem0rec.cc
@@ -845,7 +845,6 @@ rec_get_converted_size_comp_prefix_low(
}
ut_ad(len <= col->len || col->mtype == DATA_BLOB
- || col->mtype == DATA_VARMYSQL
|| (col->len == 0 && col->mtype == DATA_VARCHAR));
fixed_len = field->fixed_len;
@@ -1275,7 +1274,6 @@ rec_convert_dtuple_to_rec_comp(
} else {
ut_ad(len <= dtype_get_len(type)
|| dtype_get_mtype(type) == DATA_BLOB
- || dtype_get_mtype(type) == DATA_VARMYSQL
|| !strcmp(index->name,
FTS_INDEX_TABLE_IND_NAME));
if (len < 128
diff --git a/storage/xtradb/row/row0ftsort.cc b/storage/xtradb/row/row0ftsort.cc
index 04d3e51911c..3f7bc7c8e98 100644
--- a/storage/xtradb/row/row0ftsort.cc
+++ b/storage/xtradb/row/row0ftsort.cc
@@ -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
diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc
index 99c6d52b2db..bdcbd00ac80 100644
--- a/storage/xtradb/row/row0merge.cc
+++ b/storage/xtradb/row/row0merge.cc
@@ -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
diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc
index 5bef0ae8fb3..d0f1b1d1b89 100644
--- a/storage/xtradb/row/row0mysql.cc
+++ b/storage/xtradb/row/row0mysql.cc
@@ -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
@@ -611,6 +611,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:
diff --git a/storage/xtradb/row/row0quiesce.cc b/storage/xtradb/row/row0quiesce.cc
index 1d67d5a9717..ecd6f47947b 100644
--- a/storage/xtradb/row/row0quiesce.cc
+++ b/storage/xtradb/row/row0quiesce.cc
@@ -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:
diff --git a/storage/xtradb/srv/srv0mon.cc b/storage/xtradb/srv/srv0mon.cc
index 6595c42ca40..547d6c8c90b 100644
--- a/storage/xtradb/srv/srv0mon.cc
+++ b/storage/xtradb/srv/srv0mon.cc
@@ -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.
Copyright (c) 2013, 2014, MariaDB Corporation
@@ -1041,7 +1041,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",
diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc
index ab05605114b..7f0150f9f77 100644
--- a/storage/xtradb/srv/srv0srv.cc
+++ b/storage/xtradb/srv/srv0srv.cc
@@ -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, 2015, MariaDB Corporation.
@@ -3431,7 +3431,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);
}
diff --git a/storage/xtradb/trx/trx0roll.cc b/storage/xtradb/trx/trx0roll.cc
index 9e4340f7d13..67f63d08303 100644
--- a/storage/xtradb/trx/trx0roll.cc
+++ b/storage/xtradb/trx/trx0roll.cc
@@ -55,6 +55,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;
@@ -817,6 +820,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. */
diff --git a/storage/xtradb/ut/ut0ut.cc b/storage/xtradb/ut/ut0ut.cc
index 15c7bb503cb..121cbdb7bc0 100644
--- a/storage/xtradb/ut/ut0ut.cc
+++ b/storage/xtradb/ut/ut0ut.cc
@@ -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 */