Commit 13927f87 authored by Sergei Golubchik's avatar Sergei Golubchik

percona-server-5.5.41-37.0

parent ef7d950e
......@@ -276,6 +276,14 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
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)
......
......@@ -42,6 +42,12 @@ UNIV_INTERN dict_index_t* dict_ind_compact;
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)) {
......@@ -2650,8 +2663,15 @@ dict_foreign_remove_from_cache(
foreign);
rbt = foreign->referenced_table->referenced_rbt;
if (rbt != NULL) {
rbt_delete(rbt, foreign->id);
const ib_rbt_node_t* node
= rbt_lookup(rbt, foreign->id);
dict_foreign_t* val = *(dict_foreign_t**) node->value;
if (val == foreign) {
rbt_delete(rbt, foreign->id);
}
}
}
......@@ -2664,7 +2684,13 @@ dict_foreign_remove_from_cache(
rbt = foreign->foreign_table->foreign_rbt;
if (rbt != NULL) {
rbt_delete(rbt, foreign->id);
const ib_rbt_node_t* node
= rbt_lookup(rbt, foreign->id);
dict_foreign_t* val = *(dict_foreign_t**) node->value;
if (val == foreign) {
rbt_delete(rbt, foreign->id);
}
}
}
......@@ -6031,11 +6057,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;
......
......@@ -2681,7 +2681,7 @@ innobase_init(
innobase_hton->start_consistent_snapshot=innobase_start_trx_and_assign_read_view;
innobase_hton->flush_logs=innobase_flush_logs;
innobase_hton->show_status=innobase_show_status;
innobase_hton->flags=HTON_NO_FLAGS;
innobase_hton->flags=HTON_SUPPORTS_FOREIGN_KEYS;
innobase_hton->release_temporary_latches=innobase_release_temporary_latches;
innobase_hton->alter_table_flags = innobase_alter_table_flags;
innobase_hton->flush_changed_page_bitmaps
......@@ -10238,6 +10238,7 @@ ha_innobase::start_stmt(
thr_lock_type lock_type)
{
trx_t* trx;
DBUG_ENTER("ha_innobase::start_stmt");
update_thd(thd);
......@@ -10260,6 +10261,28 @@ ha_innobase::start_stmt(
prebuilt->hint_need_to_fetch_extra_cols = 0;
reset_template(prebuilt);
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
......@@ -10292,7 +10315,7 @@ ha_innobase::start_stmt(
innobase_register_trx(ht, thd, trx);
return(0);
DBUG_RETURN(0);
}
/******************************************************************//**
......@@ -13711,3 +13734,30 @@ innobase_convert_to_filename_charset(
return(strconvert(cs_from, from, cs_to, to, len, &errors));
}
/**********************************************************************
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;
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);
}
/*****************************************************************************
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;\
}
......
......@@ -1391,6 +1391,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.
@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"
......
......@@ -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.
@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));
}
......@@ -64,7 +64,7 @@ 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 MYSQL_SERVER_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 */
......
......@@ -252,7 +252,7 @@ log_buffer_extend(
{
ulint move_start;
ulint move_end;
byte tmp_buf[OS_FILE_LOG_BLOCK_SIZE];
byte* tmp_buf = alloca(OS_FILE_LOG_BLOCK_SIZE);
mutex_enter(&(log_sys->mutex));
......
......@@ -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);
......
......@@ -2989,7 +2989,8 @@ recv_recovery_from_checkpoint_start_func(
#endif /* UNIV_LOG_ARCHIVE */
byte* buf;
byte* log_hdr_buf;
byte log_hdr_buf_base[LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE];
byte* log_hdr_buf_base = alloca(LOG_FILE_HDR_SIZE
+ OS_FILE_LOG_BLOCK_SIZE);
ulint err;
log_hdr_buf = ut_align(log_hdr_buf_base, OS_FILE_LOG_BLOCK_SIZE);
......
/*****************************************************************************
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
......@@ -3226,6 +3226,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);
......@@ -3236,7 +3239,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";
......@@ -3643,7 +3646,7 @@ funct_exit:
srv_wake_master_thread();
return((int) err);
DBUG_RETURN((int) err);
}
/*********************************************************************//**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment