[Commits] Rev 4436: merge in lp:~maria-captains/maria/5.5

Sergei Golubchik serg at mariadb.org
Wed Feb 25 16:08:58 EET 2015


At lp:~maria-captains/maria/5.5

------------------------------------------------------------
revno: 4436 [merge]
revision-id: sergii at pisem.net-20150225140857-g3je30k015q2kog5
parent: psergey at askmonty.org-20150217120409-tw5b7o3ayc33t65p
parent: sergii at pisem.net-20150211194056-7qzjl8uhjz2129k8
committer: Sergei Golubchik <sergii at pisem.net>
branch nick: 5.5
timestamp: Wed 2015-02-25 15:08:57 +0100
message:
  merge
modified:
  storage/xtradb/CMakeLists.txt  cmakelists.txt-20081201061010-zymrrwrczns2vrex-1
  storage/xtradb/dict/dict0dict.c dict0dict.c-20081201061010-zymrrwrczns2vrex-57
  storage/xtradb/handler/ha_innodb.cc ha_innodb.cc-20081201061010-zymrrwrczns2vrex-70
  storage/xtradb/include/btr0cur.ic btr0cur.ic-20081201061010-zymrrwrczns2vrex-80
  storage/xtradb/include/dict0dict.h dict0dict.h-20081201061010-zymrrwrczns2vrex-106
  storage/xtradb/include/dict0dict.ic dict0dict.ic-20081201061010-zymrrwrczns2vrex-107
  storage/xtradb/include/univ.i  univ.i-20081201061010-zymrrwrczns2vrex-248
  storage/xtradb/log/log0log.c   log0log.c-20081201061010-zymrrwrczns2vrex-270
  storage/xtradb/log/log0online.c log0online.c-20121012153942-65yo4b140ohftzat-2
  storage/xtradb/log/log0recv.c  log0recv.c-20081201061010-zymrrwrczns2vrex-271
  storage/xtradb/row/row0mysql.c row0mysql.c-20081201061010-zymrrwrczns2vrex-336
=== modified file 'storage/xtradb/CMakeLists.txt'
--- a/storage/xtradb/CMakeLists.txt	2014-08-19 16:28:35 +0000
+++ b/storage/xtradb/CMakeLists.txt	2015-02-11 19:40:56 +0000
@@ -330,6 +330,14 @@ SET(INNOBASE_SOURCES	btr/btr0btr.c btr/b
 			ut/ut0byte.c ut/ut0dbg.c ut/ut0list.c ut/ut0mem.c ut/ut0rbt.c ut/ut0rnd.c
 			ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c ut/ut0bh.c)
 
+# These files have unused result errors, so we skip Werror
+CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR)
+IF(HAVE_WERROR)
+  INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
+  ADD_COMPILE_FLAGS(page/page0zip.c COMPILE_FLAGS "-Wno-error")
+  ADD_COMPILE_FLAGS(ut/ut0ut.c      COMPILE_FLAGS "-Wno-error")
+ENDIF()
+
 IF(WITH_INNODB)
   # Legacy option
   SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)

=== modified file 'storage/xtradb/dict/dict0dict.c'
--- a/storage/xtradb/dict/dict0dict.c	2015-02-04 12:40:46 +0000
+++ b/storage/xtradb/dict/dict0dict.c	2015-02-11 19:40:56 +0000
@@ -42,6 +42,12 @@ UNIV_INTERN dict_index_t*	dict_ind_compa
 UNIV_INTERN uint	ibuf_debug;
 #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
 
+/**********************************************************************
+Issue a warning that the row is too big. */
+void
+ib_warn_row_too_big(const dict_table_t*	table);
+
+
 #ifndef UNIV_HOTBACKUP
 #include "buf0buf.h"
 #include "data0type.h"
@@ -1892,11 +1898,18 @@ dict_index_add_to_cache(
 
 	new_index->n_fields = new_index->n_def;
 
-	if (strict && dict_index_too_big_for_tree(table, new_index)) {
+	if (dict_index_too_big_for_tree(table, new_index)) {
+
+		if (strict) {
 too_big:
-		dict_mem_index_free(new_index);
-		dict_mem_index_free(index);
-		return(DB_TOO_BIG_RECORD);
+			dict_mem_index_free(new_index);
+			dict_mem_index_free(index);
+			return(DB_TOO_BIG_RECORD);
+		} else {
+
+			ib_warn_row_too_big(table);
+
+		}
 	}
 
 	if (UNIV_UNLIKELY(index->type & DICT_UNIVERSAL)) {
@@ -6043,11 +6056,11 @@ dict_set_corrupted(
 
 	dict_index_copy_types(tuple, sys_index, 2);
 
-	btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_GE,
+	btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_LE,
 				    BTR_MODIFY_LEAF,
 				    &cursor, 0, __FILE__, __LINE__, &mtr);
 
-	if (cursor.up_match == dtuple_get_n_fields(tuple)) {
+	if (cursor.low_match == dtuple_get_n_fields(tuple)) {
 		/* UPDATE SYS_INDEXES SET TYPE=index->type
 		WHERE TABLE_ID=index->table->id AND INDEX_ID=index->id */
 		ulint	len;

=== modified file 'storage/xtradb/handler/ha_innodb.cc'
--- a/storage/xtradb/handler/ha_innodb.cc	2014-11-21 11:27:36 +0000
+++ b/storage/xtradb/handler/ha_innodb.cc	2015-02-11 19:40:56 +0000
@@ -10457,6 +10457,7 @@ ha_innobase::start_stmt(
 	thr_lock_type	lock_type)
 {
 	trx_t*		trx;
+	DBUG_ENTER("ha_innobase::start_stmt");
 
 	update_thd(thd);
 
@@ -10479,6 +10480,28 @@ ha_innobase::start_stmt(
 	prebuilt->hint_need_to_fetch_extra_cols = 0;
 	reset_template();
 
+	if (dict_table_is_temporary(prebuilt->table)
+	    && prebuilt->mysql_has_locked
+	    && prebuilt->select_lock_type == LOCK_NONE) {
+		ulint error;
+
+		switch (thd_sql_command(thd)) {
+		case SQLCOM_INSERT:
+		case SQLCOM_UPDATE:
+		case SQLCOM_DELETE:
+			init_table_handle_for_HANDLER();
+			prebuilt->select_lock_type = LOCK_X;
+			error = row_lock_table_for_mysql(prebuilt, NULL, 1);
+
+			if (error != DB_SUCCESS) {
+				error = convert_error_code_to_mysql(
+					(int) error, 0, thd);
+				DBUG_RETURN((int) error);
+			}
+			break;
+		}
+	}
+
 	if (!prebuilt->mysql_has_locked) {
 		/* This handle is for a temporary table created inside
 		this same LOCK TABLES; since MySQL does NOT call external_lock
@@ -10511,7 +10534,7 @@ ha_innobase::start_stmt(
 
 	innobase_register_trx(ht, thd, trx);
 
-	return(0);
+	DBUG_RETURN(0);
 }
 
 /******************************************************************//**
@@ -13958,6 +13981,45 @@ innobase_convert_to_filename_charset(
 }
 
 
+/**********************************************************************
+Issue a warning that the row is too big. */
+extern "C"
+void
+ib_warn_row_too_big(const dict_table_t*	table)
+{
+	/* If prefix is true then a 768-byte prefix is stored
+	locally for BLOB fields. Refer to dict_table_get_format() */
+	const bool	prefix = ((table->flags & DICT_TF_FORMAT_MASK)
+				  >> DICT_TF_FORMAT_SHIFT) < UNIV_FORMAT_B;
+
+	const ulint	free_space = page_get_free_space_of_empty(
+		table->flags & DICT_TF_COMPACT) / 2;
+
+	THD*	thd = current_thd;
+
+	if (thd) {
+		push_warning_printf(
+			thd, MYSQL_ERROR::WARN_LEVEL_WARN, HA_ERR_TO_BIG_ROW,
+			"Row size too large (> %lu). Changing some columns to TEXT"
+			" or BLOB %smay help. In current row format, BLOB prefix of"
+			" %d bytes is stored inline.", free_space
+			, prefix ? "or using ROW_FORMAT=DYNAMIC or"
+			" ROW_FORMAT=COMPRESSED ": ""
+			, prefix ? DICT_MAX_FIXED_COL_LEN : 0);
+	} else {
+		/* Note that we can't use push_warning_printf here because
+		e.g. purge thread has no thd */
+		sql_print_warning(
+			"Row size too large (> %lu). Changing some columns to TEXT"
+			" or BLOB %smay help. In current row format, BLOB prefix of"
+			" %d bytes is stored inline.", free_space
+			, prefix ? "or using ROW_FORMAT=DYNAMIC or"
+			" ROW_FORMAT=COMPRESSED ": ""
+			, prefix ? DICT_MAX_FIXED_COL_LEN : 0);
+	}
+}
+
+
 /****************************************************************************
  * DS-MRR implementation 
  ***************************************************************************/

=== modified file 'storage/xtradb/include/btr0cur.ic'
--- a/storage/xtradb/include/btr0cur.ic	2013-03-08 18:08:45 +0000
+++ b/storage/xtradb/include/btr0cur.ic	2015-02-11 19:40:56 +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
@@ -28,7 +28,7 @@ Created 10/16/1994 Heikki Tuuri
 
 #ifdef UNIV_DEBUG
 # define LIMIT_OPTIMISTIC_INSERT_DEBUG(NREC, CODE)\
-if (btr_cur_limit_optimistic_insert_debug\
+if (btr_cur_limit_optimistic_insert_debug > 1\
     && (NREC) >= (ulint)btr_cur_limit_optimistic_insert_debug) {\
         CODE;\
 }

=== modified file 'storage/xtradb/include/dict0dict.h'
--- a/storage/xtradb/include/dict0dict.h	2014-12-19 19:17:59 +0000
+++ b/storage/xtradb/include/dict0dict.h	2015-02-11 19:40:56 +0000
@@ -1399,6 +1399,14 @@ dict_table_init_referenced_rbt(
 /*===========================*/
 	dict_table_t*	table);	/*!< in: the table object whose
 				table->referenced_rbt will be initialized */
+/********************************************************************//**
+Check if it is a temporary table.
+ at return        true if temporary table flag is set. */
+UNIV_INLINE
+ibool
+dict_table_is_temporary(
+/*====================*/
+	const dict_table_t*     table);  /*!< in: table to check */
 
 #ifndef UNIV_NONINL
 #include "dict0dict.ic"

=== modified file 'storage/xtradb/include/dict0dict.ic'
--- a/storage/xtradb/include/dict0dict.ic	2014-10-06 18:06:39 +0000
+++ b/storage/xtradb/include/dict0dict.ic	2015-02-11 19:40:56 +0000
@@ -1017,3 +1017,15 @@ dict_table_init_referenced_rbt(
 	ut_a(table->referenced_rbt != NULL);
 	return(table->referenced_rbt);
 }
+
+/********************************************************************//**
+Check if it is a temporary table.
+ at return        true if temporary table flag is set. */
+UNIV_INLINE
+ibool
+dict_table_is_temporary(
+/*====================*/
+	const dict_table_t*     table)  /*!< in: table to check */
+{
+	return(table->flags & (DICT_TF2_TEMPORARY << DICT_TF2_SHIFT));
+}

=== modified file 'storage/xtradb/include/univ.i'
--- a/storage/xtradb/include/univ.i	2014-10-07 22:44:37 +0000
+++ b/storage/xtradb/include/univ.i	2015-02-11 19:40:56 +0000
@@ -64,10 +64,10 @@ component, i.e. we show M.N.P as M.N */
 	(INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)
 
 #ifndef PERCONA_INNODB_VERSION
-#define PERCONA_INNODB_VERSION 36.1
+#define PERCONA_INNODB_VERSION 37.0
 #endif
 
-#define INNODB_VERSION_STR	"5.5.40-MariaDB-" IB_TO_STR(PERCONA_INNODB_VERSION)
+#define INNODB_VERSION_STR	"5.5.41-MariaDB-" IB_TO_STR(PERCONA_INNODB_VERSION)
 
 #define REFMAN "http://dev.mysql.com/doc/refman/"	\
 	IB_TO_STR(MYSQL_MAJOR_VERSION) "."		\
@@ -122,6 +122,10 @@ if we are compiling on Windows. */
 #  include <sched.h>
 # endif
 
+# ifdef HAVE_MALLOC_H
+#  include <malloc.h>
+# endif
+
 /* We only try to do explicit inlining of functions with gcc and
 Sun Studio */
 

=== modified file 'storage/xtradb/log/log0log.c'
--- a/storage/xtradb/log/log0log.c	2014-10-06 18:06:39 +0000
+++ b/storage/xtradb/log/log0log.c	2015-02-11 19:40:56 +0000
@@ -260,7 +260,7 @@ log_buffer_extend(
 {
 	ulint	move_start;
 	ulint	move_end;
-	byte	*tmp_buf=alloca(OS_FILE_LOG_BLOCK_SIZE);
+	byte*	tmp_buf = alloca(OS_FILE_LOG_BLOCK_SIZE);
 
 	mutex_enter(&(log_sys->mutex));
 

=== modified file 'storage/xtradb/log/log0online.c'
--- a/storage/xtradb/log/log0online.c	2014-10-06 17:56:00 +0000
+++ b/storage/xtradb/log/log0online.c	2015-02-11 17:32:40 +0000
@@ -1817,7 +1817,7 @@ log_online_purge_changed_page_bitmaps(
 		return TRUE;
 	}
 
-	if (srv_track_changed_pages && lsn >= log_bmp_sys->end_lsn) {
+	if (srv_track_changed_pages && lsn > log_bmp_sys->end_lsn) {
 		/* If we have to delete the current output file, close it
 		first. */
 		os_file_close(log_bmp_sys->out.file);

=== modified file 'storage/xtradb/log/log0recv.c'
--- a/storage/xtradb/log/log0recv.c	2013-11-19 14:43:22 +0000
+++ b/storage/xtradb/log/log0recv.c	2015-02-11 19:40:56 +0000
@@ -2996,10 +2996,10 @@ recv_recovery_from_checkpoint_start_func
 #endif /* UNIV_LOG_ARCHIVE */
 	byte*		buf;
 	byte*		log_hdr_buf;
-	byte		*log_hdr_buf_base;
+	byte*		log_hdr_buf_base = alloca(LOG_FILE_HDR_SIZE
+						  + OS_FILE_LOG_BLOCK_SIZE);
 	ulint		err;
 
-        log_hdr_buf_base= alloca(LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE);
 	log_hdr_buf = ut_align(log_hdr_buf_base, OS_FILE_LOG_BLOCK_SIZE);
 
 #ifdef UNIV_LOG_ARCHIVE

=== modified file 'storage/xtradb/row/row0mysql.c'
--- a/storage/xtradb/row/row0mysql.c	2014-02-14 13:09:29 +0000
+++ b/storage/xtradb/row/row0mysql.c	2015-02-11 19:40:56 +0000
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2000, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 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
@@ -3227,6 +3227,9 @@ row_drop_table_for_mysql(
 	ulint		namelen;
 	ibool		locked_dictionary	= FALSE;
 	pars_info_t*    info			= NULL;
+	DBUG_ENTER("row_drop_table_for_mysql");
+
+	DBUG_PRINT("row_drop_table_for_mysql", ("table: %s", name));
 
 	ut_a(name != NULL);
 
@@ -3237,7 +3240,7 @@ row_drop_table_for_mysql(
 		      "InnoDB: Shut down mysqld and edit my.cnf so that newraw"
 		      " is replaced with raw.\n", stderr);
 
-		return(DB_ERROR);
+		DBUG_RETURN(DB_ERROR);
 	}
 
 	trx->op_info = "dropping table";
@@ -3644,7 +3647,7 @@ row_drop_table_for_mysql(
 
 	srv_wake_master_thread();
 
-	return((int) err);
+	DBUG_RETURN((int) err);
 }
 
 /*********************************************************************//**



More information about the commits mailing list