[Commits] Rev 4607: innodb 5.6.23 in lp:~maria-captains/maria/10.0

Sergei Golubchik serg at mariadb.org
Wed Feb 18 18:34:12 EET 2015


At lp:~maria-captains/maria/10.0

------------------------------------------------------------
revno: 4607 [merge]
revision-id: sergii at pisem.net-20150218163406-blp7yyz7s7uz0qfu
parent: sergii at pisem.net-20150217170756-4nfjs6gpzebw8h2g
parent: sergii at pisem.net-20150218152046-wzqofrzkj3c9o4l6
committer: Sergei Golubchik <sergii at pisem.net>
branch nick: 10.0
timestamp: Wed 2015-02-18 17:34:06 +0100
message:
  innodb 5.6.23
modified:
  storage/innobase/btr/btr0cur.cc btr0cur.cc-20120801142620-llsyl0eu3t2snj1c-14
  storage/innobase/dict/dict0dict.cc dict0dict.cc-20120801142620-llsyl0eu3t2snj1c-29
  storage/innobase/dict/dict0mem.cc dict0mem.cc-20120801142620-llsyl0eu3t2snj1c-31
  storage/innobase/fts/fts0ast.cc fts0ast.cc-20120801142620-llsyl0eu3t2snj1c-239
  storage/innobase/fts/fts0opt.cc fts0opt.cc-20120801142620-llsyl0eu3t2snj1c-244
  storage/innobase/fts/fts0que.cc fts0que.cc-20120801142620-llsyl0eu3t2snj1c-247
  storage/innobase/handler/ha_innodb.cc 2 at 16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Fhandler%2Fha_innodb.cc
  storage/innobase/handler/handler0alter.cc 1845 at 16c675df-0fcb-4bc9-8058-dcc011a37293:branches%2Fzip%2Fhandler%2Fhandler0alter.cc
  storage/innobase/ibuf/ibuf0ibuf.cc ibuf0ibuf.cc-20120801142620-llsyl0eu3t2snj1c-43
  storage/innobase/include/buf0buf.h 2 at 16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Fbuf0buf.h
  storage/innobase/include/buf0buf.ic 2 at 16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Fbuf0buf.ic
  storage/innobase/include/db0err.h 2 at 16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Fdb0err.h
  storage/innobase/include/fts0ast.h fts0ast.h-20120801142620-llsyl0eu3t2snj1c-50
  storage/innobase/include/ha_prototypes.h 559 at 16c675df-0fcb-4bc9-8058-dcc011a37293:branches%2Fzip%2Finclude%2Fha_prototypes.h
  storage/innobase/include/os0file.h 2 at 16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Fos0file.h
  storage/innobase/include/row0merge.h 1414 at 16c675df-0fcb-4bc9-8058-dcc011a37293:branches%2Fzip%2Finclude%2Frow0merge.h
  storage/innobase/include/trx0roll.h 2 at 16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Ftrx0roll.h
  storage/innobase/lock/lock0lock.cc lock0lock.cc-20120801142620-llsyl0eu3t2snj1c-67
  storage/innobase/log/log0log.cc log0log.cc-20120801142620-llsyl0eu3t2snj1c-69
  storage/innobase/log/log0recv.cc log0recv.cc-20120801142620-llsyl0eu3t2snj1c-70
  storage/innobase/os/os0file.cc os0file.cc-20120801142620-llsyl0eu3t2snj1c-77
  storage/innobase/row/row0ftsort.cc row0ftsort.cc-20120801142620-llsyl0eu3t2snj1c-94
  storage/innobase/row/row0merge.cc row0merge.cc-20120801142620-llsyl0eu3t2snj1c-96
  storage/innobase/row/row0mysql.cc row0mysql.cc-20120801142620-llsyl0eu3t2snj1c-97
  storage/innobase/row/row0quiesce.cc row0quiesce.cc-20130218135918-nni3yyxk0hzfnlkm-4
  storage/innobase/srv/srv0mon.cc srv0mon.cc-20120801142620-llsyl0eu3t2snj1c-107
  storage/innobase/srv/srv0srv.cc srv0srv.cc-20120801142620-llsyl0eu3t2snj1c-108
  storage/innobase/trx/trx0roll.cc trx0roll.cc-20120801142620-llsyl0eu3t2snj1c-116
  storage/innobase/ut/ut0ut.cc   ut0ut.cc-20120801142620-llsyl0eu3t2snj1c-130
=== modified file 'storage/innobase/btr/btr0cur.cc'
--- a/storage/innobase/btr/btr0cur.cc	2015-01-21 13:33:39 +0000
+++ b/storage/innobase/btr/btr0cur.cc	2015-02-18 16:34:06 +0000
@@ -2368,15 +2368,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.
- at return	DB_SUCCESS or DB_TOO_BIG_RECORD. */
+ at 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 */
@@ -2386,11 +2386,11 @@ btr_check_blob_limit(const big_rec_t*	bi
 
 	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);
@@ -4453,7 +4453,7 @@ Stores the fields in big_rec_vec to the
 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.
- at return	DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
+ at 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(

=== modified file 'storage/innobase/dict/dict0dict.cc'
--- a/storage/innobase/dict/dict0dict.cc	2015-01-21 13:33:39 +0000
+++ b/storage/innobase/dict/dict0dict.cc	2015-02-18 16:34:06 +0000
@@ -2427,10 +2427,10 @@ dict_index_add_to_cache(
 			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);
-
 		}
 	}
 

=== modified file 'storage/innobase/dict/dict0mem.cc'
--- a/storage/innobase/dict/dict0mem.cc	2014-11-20 15:59:22 +0000
+++ b/storage/innobase/dict/dict0mem.cc	2015-02-18 16:34:06 +0000
@@ -319,6 +319,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. */
@@ -386,14 +389,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;
+			}
 		}
 	}
 
@@ -403,6 +445,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

=== modified file 'storage/innobase/fts/fts0ast.cc'
--- a/storage/innobase/fts/fts0ast.cc	2014-09-11 14:42:54 +0000
+++ b/storage/innobase/fts/fts0ast.cc	2015-02-18 16:34:06 +0000
@@ -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 */

=== modified file 'storage/innobase/fts/fts0opt.cc'
--- a/storage/innobase/fts/fts0opt.cc	2015-01-21 13:33:39 +0000
+++ b/storage/innobase/fts/fts0opt.cc	2015-02-18 16:34:06 +0000
@@ -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);

=== modified file 'storage/innobase/fts/fts0que.cc'
--- a/storage/innobase/fts/fts0que.cc	2014-10-24 19:26:31 +0000
+++ b/storage/innobase/fts/fts0que.cc	2015-02-18 16:34:06 +0000
@@ -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);
 }
 
 /*******************************************************************//**

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	2015-01-21 13:33:39 +0000
+++ b/storage/innobase/handler/ha_innodb.cc	2015-02-18 16:34:06 +0000
@@ -1531,6 +1531,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));
@@ -13857,10 +13866,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);
 		}

=== modified file 'storage/innobase/handler/handler0alter.cc'
--- a/storage/innobase/handler/handler0alter.cc	2015-01-21 13:33:39 +0000
+++ b/storage/innobase/handler/handler0alter.cc	2015-02-18 16:34:06 +0000
@@ -4435,11 +4435,15 @@ innobase_rename_column_try(
 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)) {
@@ -4467,6 +4471,11 @@ innobase_rename_column_try(
 			if (error != DB_SUCCESS) {
 				goto err_exit;
 			}
+			foreign_modified = true;
+		}
+
+		if (foreign_modified) {
+			fk_evict.push_back(foreign);
 		}
 	}
 
@@ -4475,7 +4484,9 @@ innobase_rename_column_try(
 	     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;
@@ -4502,7 +4513,17 @@ innobase_rename_column_try(
 			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 = "";

=== modified file 'storage/innobase/ibuf/ibuf0ibuf.cc'
--- a/storage/innobase/ibuf/ibuf0ibuf.cc	2015-01-21 13:33:39 +0000
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc	2015-02-18 16:34:06 +0000
@@ -3885,7 +3885,7 @@ ibuf_insert(
 	{
 		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

=== modified file 'storage/innobase/include/buf0buf.h'
--- a/storage/innobase/include/buf0buf.h	2015-01-19 10:39:17 +0000
+++ b/storage/innobase/include/buf0buf.h	2015-02-18 16:34:06 +0000
@@ -1268,7 +1268,7 @@ page_hash lock is acquired in the specif
 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.
- at return	block, NULL if not found */
+ at return	block, NULL if not found, or watch sentinel (if watch is true) */
 UNIV_INLINE
 buf_page_t*
 buf_page_hash_get_locked(
@@ -1284,9 +1284,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
@@ -1326,6 +1328,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)

=== modified file 'storage/innobase/include/buf0buf.ic'
--- a/storage/innobase/include/buf0buf.ic	2014-09-11 14:42:54 +0000
+++ b/storage/innobase/include/buf0buf.ic	2015-02-18 16:34:06 +0000
@@ -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
@@ -1172,7 +1172,7 @@ page_hash lock is acquired in the specif
 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.
- at return	block, NULL if not found */
+ at return	block, NULL if not found, or watch sentinel (if watch is true) */
 UNIV_INLINE
 buf_page_t*
 buf_page_hash_get_locked(
@@ -1188,9 +1188,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;
@@ -1221,7 +1223,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;
 	}
 

=== modified file 'storage/innobase/include/db0err.h'
--- a/storage/innobase/include/db0err.h	2014-05-07 15:32:23 +0000
+++ b/storage/innobase/include/db0err.h	2015-02-18 16:34:06 +0000
@@ -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,

=== modified file 'storage/innobase/include/fts0ast.h'
--- a/storage/innobase/include/fts0ast.h	2014-09-11 14:42:54 +0000
+++ b/storage/innobase/include/fts0ast.h	2015-02-18 16:34:06 +0000
@@ -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 */

=== modified file 'storage/innobase/include/ha_prototypes.h'
--- a/storage/innobase/include/ha_prototypes.h	2014-05-06 07:57:39 +0000
+++ b/storage/innobase/include/ha_prototypes.h	2015-02-18 16:34:06 +0000
@@ -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

=== modified file 'storage/innobase/include/os0file.h'
--- a/storage/innobase/include/os0file.h	2014-11-25 09:38:01 +0000
+++ b/storage/innobase/include/os0file.h	2015-02-18 16:34:06 +0000
@@ -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

=== modified file 'storage/innobase/include/row0merge.h'
--- a/storage/innobase/include/row0merge.h	2014-02-26 18:22:48 +0000
+++ b/storage/innobase/include/row0merge.h	2015-02-18 16:34:06 +0000
@@ -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

=== modified file 'storage/innobase/include/trx0roll.h'
--- a/storage/innobase/include/trx0roll.h	2014-02-26 18:22:48 +0000
+++ b/storage/innobase/include/trx0roll.h	2015-02-18 16:34:06 +0000
@@ -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
@@ -32,6 +32,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.

=== modified file 'storage/innobase/lock/lock0lock.cc'
--- a/storage/innobase/lock/lock0lock.cc	2015-02-10 13:15:27 +0000
+++ b/storage/innobase/lock/lock0lock.cc	2015-02-18 16:34:06 +0000
@@ -2066,7 +2066,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:

=== modified file 'storage/innobase/log/log0log.cc'
--- a/storage/innobase/log/log0log.cc	2015-01-21 13:33:39 +0000
+++ b/storage/innobase/log/log0log.cc	2015-02-18 16:34:06 +0000
@@ -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
@@ -48,7 +48,7 @@ Created 12/9/1995 Heikki Tuuri
 #include "srv0start.h"
 #include "trx0sys.h"
 #include "trx0trx.h"
-#include "ha_prototypes.h"
+#include "trx0roll.h"
 #include "srv0mon.h"
 
 /*
@@ -3212,6 +3212,12 @@ logs_empty_and_mark_files_at_shutdown(vo
 
 	ib_logf(IB_LOG_LEVEL_INFO, "Starting shutdown...");
 
+	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 */
 

=== modified file 'storage/innobase/log/log0recv.cc'
--- a/storage/innobase/log/log0recv.cc	2014-09-11 14:42:54 +0000
+++ b/storage/innobase/log/log0recv.cc	2015-02-18 16:34:06 +0000
@@ -3486,6 +3486,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);
 	}
 }

=== modified file 'storage/innobase/os/os0file.cc'
--- a/storage/innobase/os/os0file.cc	2015-02-13 09:49:31 +0000
+++ b/storage/innobase/os/os0file.cc	2015-02-18 16:34:06 +0000
@@ -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
@@ -2651,13 +2651,18 @@ os_file_read_func(
 	ret = os_file_pread(file, buf, n, offset);
 
 	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__ */
 #ifdef __WIN__
 error_handling:
@@ -2777,8 +2782,17 @@ os_file_read_no_error_handling_func(
 	ret = os_file_pread(file, buf, n, offset);
 
 	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__ */
 #ifdef __WIN__
@@ -2997,18 +3011,26 @@ os_file_write_func(
 	if (!os_has_said_disk_full) {
 		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",

=== modified file 'storage/innobase/row/row0ftsort.cc'
--- a/storage/innobase/row/row0ftsort.cc	2014-10-24 19:26:31 +0000
+++ b/storage/innobase/row/row0ftsort.cc	2015-02-18 16:34:06 +0000
@@ -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

=== modified file 'storage/innobase/row/row0merge.cc'
--- a/storage/innobase/row/row0merge.cc	2015-02-18 04:59:28 +0000
+++ b/storage/innobase/row/row0merge.cc	2015-02-18 16:34:06 +0000
@@ -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

=== modified file 'storage/innobase/row/row0mysql.cc'
--- a/storage/innobase/row/row0mysql.cc	2015-02-13 09:49:31 +0000
+++ b/storage/innobase/row/row0mysql.cc	2015-02-18 16:34:06 +0000
@@ -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
@@ -610,6 +610,7 @@ row_mysql_handle_errors(
 	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:

=== modified file 'storage/innobase/row/row0quiesce.cc'
--- a/storage/innobase/row/row0quiesce.cc	2014-05-07 15:32:23 +0000
+++ b/storage/innobase/row/row0quiesce.cc	2015-02-18 16:34:06 +0000
@@ -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:

=== modified file 'storage/innobase/srv/srv0mon.cc'
--- a/storage/innobase/srv/srv0mon.cc	2014-10-26 05:22:51 +0000
+++ b/storage/innobase/srv/srv0mon.cc	2015-02-18 16:34:06 +0000
@@ -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_inf
 
 	{"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",

=== modified file 'storage/innobase/srv/srv0srv.cc'
--- a/storage/innobase/srv/srv0srv.cc	2014-11-21 19:20:39 +0000
+++ b/storage/innobase/srv/srv0srv.cc	2015-02-18 16:34:06 +0000
@@ -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.
@@ -2657,7 +2657,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);
 }

=== modified file 'storage/innobase/trx/trx0roll.cc'
--- a/storage/innobase/trx/trx0roll.cc	2014-11-20 15:59:22 +0000
+++ b/storage/innobase/trx/trx0roll.cc	2015-02-18 16:34:06 +0000
@@ -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
 
 	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. */
 

=== modified file 'storage/innobase/ut/ut0ut.cc'
--- a/storage/innobase/ut/ut0ut.cc	2014-05-07 15:32:23 +0000
+++ b/storage/innobase/ut/ut0ut.cc	2015-02-18 16:34:06 +0000
@@ -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
@@ -822,6 +822,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 */



More information about the commits mailing list