Skip to content

Commit 2a1be9c

Browse files
author
Sergei Golubchik
committed
XtraDB 5.5.41-37.0
2 parents d996dc2 + 13927f8 commit 2a1be9c

File tree

11 files changed

+128
-18
lines changed

11 files changed

+128
-18
lines changed

storage/xtradb/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,14 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
330330
ut/ut0byte.c ut/ut0dbg.c ut/ut0list.c ut/ut0mem.c ut/ut0rbt.c ut/ut0rnd.c
331331
ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c ut/ut0bh.c)
332332

333+
# These files have unused result errors, so we skip Werror
334+
CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR)
335+
IF(HAVE_WERROR)
336+
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
337+
ADD_COMPILE_FLAGS(page/page0zip.c COMPILE_FLAGS "-Wno-error")
338+
ADD_COMPILE_FLAGS(ut/ut0ut.c COMPILE_FLAGS "-Wno-error")
339+
ENDIF()
340+
333341
IF(WITH_INNODB)
334342
# Legacy option
335343
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)

storage/xtradb/dict/dict0dict.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ UNIV_INTERN dict_index_t* dict_ind_compact;
4242
UNIV_INTERN uint ibuf_debug;
4343
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
4444

45+
/**********************************************************************
46+
Issue a warning that the row is too big. */
47+
void
48+
ib_warn_row_too_big(const dict_table_t* table);
49+
50+
4551
#ifndef UNIV_HOTBACKUP
4652
#include "buf0buf.h"
4753
#include "data0type.h"
@@ -1892,11 +1898,18 @@ dict_index_add_to_cache(
18921898

18931899
new_index->n_fields = new_index->n_def;
18941900

1895-
if (strict && dict_index_too_big_for_tree(table, new_index)) {
1901+
if (dict_index_too_big_for_tree(table, new_index)) {
1902+
1903+
if (strict) {
18961904
too_big:
1897-
dict_mem_index_free(new_index);
1898-
dict_mem_index_free(index);
1899-
return(DB_TOO_BIG_RECORD);
1905+
dict_mem_index_free(new_index);
1906+
dict_mem_index_free(index);
1907+
return(DB_TOO_BIG_RECORD);
1908+
} else {
1909+
1910+
ib_warn_row_too_big(table);
1911+
1912+
}
19001913
}
19011914

19021915
if (UNIV_UNLIKELY(index->type & DICT_UNIVERSAL)) {
@@ -6043,11 +6056,11 @@ dict_set_corrupted(
60436056

60446057
dict_index_copy_types(tuple, sys_index, 2);
60456058

6046-
btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_GE,
6059+
btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_LE,
60476060
BTR_MODIFY_LEAF,
60486061
&cursor, 0, __FILE__, __LINE__, &mtr);
60496062

6050-
if (cursor.up_match == dtuple_get_n_fields(tuple)) {
6063+
if (cursor.low_match == dtuple_get_n_fields(tuple)) {
60516064
/* UPDATE SYS_INDEXES SET TYPE=index->type
60526065
WHERE TABLE_ID=index->table->id AND INDEX_ID=index->id */
60536066
ulint len;

storage/xtradb/handler/ha_innodb.cc

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10457,6 +10457,7 @@ ha_innobase::start_stmt(
1045710457
thr_lock_type lock_type)
1045810458
{
1045910459
trx_t* trx;
10460+
DBUG_ENTER("ha_innobase::start_stmt");
1046010461

1046110462
update_thd(thd);
1046210463

@@ -10479,6 +10480,28 @@ ha_innobase::start_stmt(
1047910480
prebuilt->hint_need_to_fetch_extra_cols = 0;
1048010481
reset_template();
1048110482

10483+
if (dict_table_is_temporary(prebuilt->table)
10484+
&& prebuilt->mysql_has_locked
10485+
&& prebuilt->select_lock_type == LOCK_NONE) {
10486+
ulint error;
10487+
10488+
switch (thd_sql_command(thd)) {
10489+
case SQLCOM_INSERT:
10490+
case SQLCOM_UPDATE:
10491+
case SQLCOM_DELETE:
10492+
init_table_handle_for_HANDLER();
10493+
prebuilt->select_lock_type = LOCK_X;
10494+
error = row_lock_table_for_mysql(prebuilt, NULL, 1);
10495+
10496+
if (error != DB_SUCCESS) {
10497+
error = convert_error_code_to_mysql(
10498+
(int) error, 0, thd);
10499+
DBUG_RETURN((int) error);
10500+
}
10501+
break;
10502+
}
10503+
}
10504+
1048210505
if (!prebuilt->mysql_has_locked) {
1048310506
/* This handle is for a temporary table created inside
1048410507
this same LOCK TABLES; since MySQL does NOT call external_lock
@@ -10511,7 +10534,7 @@ ha_innobase::start_stmt(
1051110534

1051210535
innobase_register_trx(ht, thd, trx);
1051310536

10514-
return(0);
10537+
DBUG_RETURN(0);
1051510538
}
1051610539

1051710540
/******************************************************************//**
@@ -13958,6 +13981,45 @@ innobase_convert_to_filename_charset(
1395813981
}
1395913982

1396013983

13984+
/**********************************************************************
13985+
Issue a warning that the row is too big. */
13986+
extern "C"
13987+
void
13988+
ib_warn_row_too_big(const dict_table_t* table)
13989+
{
13990+
/* If prefix is true then a 768-byte prefix is stored
13991+
locally for BLOB fields. Refer to dict_table_get_format() */
13992+
const bool prefix = ((table->flags & DICT_TF_FORMAT_MASK)
13993+
>> DICT_TF_FORMAT_SHIFT) < UNIV_FORMAT_B;
13994+
13995+
const ulint free_space = page_get_free_space_of_empty(
13996+
table->flags & DICT_TF_COMPACT) / 2;
13997+
13998+
THD* thd = current_thd;
13999+
14000+
if (thd) {
14001+
push_warning_printf(
14002+
thd, MYSQL_ERROR::WARN_LEVEL_WARN, HA_ERR_TO_BIG_ROW,
14003+
"Row size too large (> %lu). Changing some columns to TEXT"
14004+
" or BLOB %smay help. In current row format, BLOB prefix of"
14005+
" %d bytes is stored inline.", free_space
14006+
, prefix ? "or using ROW_FORMAT=DYNAMIC or"
14007+
" ROW_FORMAT=COMPRESSED ": ""
14008+
, prefix ? DICT_MAX_FIXED_COL_LEN : 0);
14009+
} else {
14010+
/* Note that we can't use push_warning_printf here because
14011+
e.g. purge thread has no thd */
14012+
sql_print_warning(
14013+
"Row size too large (> %lu). Changing some columns to TEXT"
14014+
" or BLOB %smay help. In current row format, BLOB prefix of"
14015+
" %d bytes is stored inline.", free_space
14016+
, prefix ? "or using ROW_FORMAT=DYNAMIC or"
14017+
" ROW_FORMAT=COMPRESSED ": ""
14018+
, prefix ? DICT_MAX_FIXED_COL_LEN : 0);
14019+
}
14020+
}
14021+
14022+
1396114023
/****************************************************************************
1396214024
* DS-MRR implementation
1396314025
***************************************************************************/

storage/xtradb/include/btr0cur.ic

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22

3-
Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
44

55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -28,7 +28,7 @@ Created 10/16/1994 Heikki Tuuri
2828

2929
#ifdef UNIV_DEBUG
3030
# define LIMIT_OPTIMISTIC_INSERT_DEBUG(NREC, CODE)\
31-
if (btr_cur_limit_optimistic_insert_debug\
31+
if (btr_cur_limit_optimistic_insert_debug > 1\
3232
&& (NREC) >= (ulint)btr_cur_limit_optimistic_insert_debug) {\
3333
CODE;\
3434
}

storage/xtradb/include/dict0dict.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,14 @@ dict_table_init_referenced_rbt(
13991399
/*===========================*/
14001400
dict_table_t* table); /*!< in: the table object whose
14011401
table->referenced_rbt will be initialized */
1402+
/********************************************************************//**
1403+
Check if it is a temporary table.
1404+
@return true if temporary table flag is set. */
1405+
UNIV_INLINE
1406+
ibool
1407+
dict_table_is_temporary(
1408+
/*====================*/
1409+
const dict_table_t* table); /*!< in: table to check */
14021410

14031411
#ifndef UNIV_NONINL
14041412
#include "dict0dict.ic"

storage/xtradb/include/dict0dict.ic

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,3 +1017,15 @@ dict_table_init_referenced_rbt(
10171017
ut_a(table->referenced_rbt != NULL);
10181018
return(table->referenced_rbt);
10191019
}
1020+
1021+
/********************************************************************//**
1022+
Check if it is a temporary table.
1023+
@return true if temporary table flag is set. */
1024+
UNIV_INLINE
1025+
ibool
1026+
dict_table_is_temporary(
1027+
/*====================*/
1028+
const dict_table_t* table) /*!< in: table to check */
1029+
{
1030+
return(table->flags & (DICT_TF2_TEMPORARY << DICT_TF2_SHIFT));
1031+
}

storage/xtradb/include/univ.i

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ component, i.e. we show M.N.P as M.N */
6464
(INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)
6565

6666
#ifndef PERCONA_INNODB_VERSION
67-
#define PERCONA_INNODB_VERSION 36.1
67+
#define PERCONA_INNODB_VERSION 37.0
6868
#endif
6969

70-
#define INNODB_VERSION_STR "5.5.40-MariaDB-" IB_TO_STR(PERCONA_INNODB_VERSION)
70+
#define INNODB_VERSION_STR "5.5.41-MariaDB-" IB_TO_STR(PERCONA_INNODB_VERSION)
7171

7272
#define REFMAN "http://dev.mysql.com/doc/refman/" \
7373
IB_TO_STR(MYSQL_MAJOR_VERSION) "." \
@@ -122,6 +122,10 @@ if we are compiling on Windows. */
122122
# include <sched.h>
123123
# endif
124124

125+
# ifdef HAVE_MALLOC_H
126+
# include <malloc.h>
127+
# endif
128+
125129
/* We only try to do explicit inlining of functions with gcc and
126130
Sun Studio */
127131

storage/xtradb/log/log0log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ log_buffer_extend(
260260
{
261261
ulint move_start;
262262
ulint move_end;
263-
byte *tmp_buf=alloca(OS_FILE_LOG_BLOCK_SIZE);
263+
byte* tmp_buf = alloca(OS_FILE_LOG_BLOCK_SIZE);
264264

265265
mutex_enter(&(log_sys->mutex));
266266

storage/xtradb/log/log0online.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,7 @@ log_online_purge_changed_page_bitmaps(
18171817
return TRUE;
18181818
}
18191819

1820-
if (srv_track_changed_pages && lsn >= log_bmp_sys->end_lsn) {
1820+
if (srv_track_changed_pages && lsn > log_bmp_sys->end_lsn) {
18211821
/* If we have to delete the current output file, close it
18221822
first. */
18231823
os_file_close(log_bmp_sys->out.file);

storage/xtradb/log/log0recv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2996,10 +2996,10 @@ recv_recovery_from_checkpoint_start_func(
29962996
#endif /* UNIV_LOG_ARCHIVE */
29972997
byte* buf;
29982998
byte* log_hdr_buf;
2999-
byte *log_hdr_buf_base;
2999+
byte* log_hdr_buf_base = alloca(LOG_FILE_HDR_SIZE
3000+
+ OS_FILE_LOG_BLOCK_SIZE);
30003001
ulint err;
30013002

3002-
log_hdr_buf_base= alloca(LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE);
30033003
log_hdr_buf = ut_align(log_hdr_buf_base, OS_FILE_LOG_BLOCK_SIZE);
30043004

30053005
#ifdef UNIV_LOG_ARCHIVE

0 commit comments

Comments
 (0)