Skip to content

Commit

Permalink
Merge 10.0 into 10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jan 23, 2019
2 parents 52d1303 + 2a0f1d6 commit 3b6d2ef
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 19 deletions.
2 changes: 2 additions & 0 deletions mysql-test/r/huge_frm-6224.result
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
set global max_allowed_packet=1024*1024*10;
ERROR HY000: The definition for table `t1` is too big
set global max_allowed_packet=default;
24 changes: 24 additions & 0 deletions mysql-test/r/range_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,27 @@ pk f1 f2 f3 pk f1 f2 f3 f4 f5
2 6 v NULL 14 1 q NULL 4 q
3 7 c NULL 14 1 q NULL 4 q
drop table t1,t2;
#
# MDEV-14440: Server crash in in handler::ha_external_lock or Assertion `inited==RND'
# failed in handler::ha_rnd_end upon SELECT from partitioned table
#
set @optimizer_switch_save= @@optimizer_switch;
set optimizer_switch='index_merge_sort_intersection=off';
create table t0 (a int)engine=innodb;
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (
a int, b int, c int,
key(a),key(b),key(c)
)engine=innodb;
insert into t1
select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a
from t0 A, t0 B, t0 C, t0 D where D.a<5;
set @@global.debug_dbug="+d,ha_index_init_fail";
explain select * from t1 where a=10 and b=10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 1 Using intersect(a,b); Using where
select * from t1 where a=10 and b=10;
ERROR HY000: Table definition has changed, please retry transaction
DROP TABLE t0,t1;
set @@global.debug_dbug="-d";
set @@optimizer_switch= @optimizer_switch_save;
9 changes: 9 additions & 0 deletions mysql-test/suite/innodb/r/innodb_28867993.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
create table t1 (a int) engine=innodb;
insert t1 values (1),(2);
create database ib_logfile2;
select * from t1;
a
1
2
drop table t1;
drop database ib_logfile2;
12 changes: 12 additions & 0 deletions mysql-test/suite/innodb/t/innodb_28867993.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Bug#28867993: POSSIBLE ISSUE WITH MYSQL SERVER RESTART
#

source include/have_innodb.inc;
create table t1 (a int) engine=innodb;
insert t1 values (1),(2);
create database ib_logfile2;
source include/restart_mysqld.inc;
select * from t1;
drop table t1;
drop database ib_logfile2;
11 changes: 9 additions & 2 deletions mysql-test/t/huge_frm-6224.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,24 @@
# verify that huge frms are rejected during creation, not on opening
#
--source include/have_partition.inc
set global max_allowed_packet=1024*1024*10;
connect con1,localhost,root;

let $n=5646;
let $n=8164;
let $a=create table t1 (a int) engine=myisam partition by hash(a) partitions $n (;
dec $n;
while ($n)
{
let $a=$a partition p01234567890123456789012345678901234567890123456789012345678$n,;
let $a=$a partition p01234567890123456789012345678901234567890123456789012345678$n COMMENT 'partition p01234567890123456789012345678901234567890123456789012345678$n',;
dec $n;
}

--disable_query_log
--error ER_TABLE_DEFINITION_TOO_BIG
eval $a partition foo);
--enable_query_log

connection default;
disconnect con1;
set global max_allowed_packet=default;

25 changes: 25 additions & 0 deletions mysql-test/t/range_innodb.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
--echo #

--source include/have_innodb.inc
--source include/have_debug.inc

--disable_warnings
drop table if exists t0, t1, t2;
Expand Down Expand Up @@ -62,3 +63,27 @@ INSERT INTO t2 VALUES (4,'q'),(NULL,'j');
SELECT * FROM t1 AS t1_1, t1 AS t1_2, t2
WHERE f5 = t1_2.f2 AND ( t1_1.f1 = 103 AND t1_1.f2 = 'o' OR t1_1.pk < f4 );
drop table t1,t2;

--echo #
--echo # MDEV-14440: Server crash in in handler::ha_external_lock or Assertion `inited==RND'
--echo # failed in handler::ha_rnd_end upon SELECT from partitioned table
--echo #

set @optimizer_switch_save= @@optimizer_switch;
set optimizer_switch='index_merge_sort_intersection=off';
create table t0 (a int)engine=innodb;
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (
a int, b int, c int,
key(a),key(b),key(c)
)engine=innodb;
insert into t1
select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a
from t0 A, t0 B, t0 C, t0 D where D.a<5;
set @@global.debug_dbug="+d,ha_index_init_fail";
explain select * from t1 where a=10 and b=10;
--error ER_TABLE_DEF_CHANGED
select * from t1 where a=10 and b=10;
DROP TABLE t0,t1;
set @@global.debug_dbug="-d";
set @@optimizer_switch= @optimizer_switch_save;
3 changes: 3 additions & 0 deletions sql/opt_range.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler,
head->column_bitmaps_set(save_read_set, save_write_set);
delete file;
file= save_file;
free_file= false;
DBUG_RETURN(1);
}

Expand Down Expand Up @@ -6557,6 +6558,8 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree,
if (ror_intersect_add(intersect, cpk_scan, TRUE) &&
(intersect->total_cost < min_cost))
intersect_best= intersect; //just set pointer here
else
cpk_scan= 0; // Don't use cpk_scan
}
else
cpk_scan= 0; // Don't use cpk_scan
Expand Down
2 changes: 1 addition & 1 deletion sql/unireg.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,

#define FRM_HEADER_SIZE 64
#define FRM_FORMINFO_SIZE 288
#define FRM_MAX_SIZE (512*1024)
#define FRM_MAX_SIZE (1024*1024)

static inline bool is_binary_frm_header(uchar *head)
{
Expand Down
15 changes: 7 additions & 8 deletions storage/innobase/fil/fil0fil.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2014, 2018, MariaDB Corporation.
Copyright (c) 2014, 2019, MariaDB Corporation.
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
Expand Down Expand Up @@ -838,10 +838,9 @@ fil_try_to_close_file_in_LRU(
}

/** Flush any writes cached by the file system.
@param[in,out] space tablespace */
static
void
fil_flush_low(fil_space_t* space)
@param[in,out] space tablespace
@param[in] metadata whether to update file system metadata */
static void fil_flush_low(fil_space_t* space, bool metadata = false)
{
ut_ad(mutex_own(&fil_system->mutex));
ut_ad(space);
Expand All @@ -865,7 +864,7 @@ fil_flush_low(fil_space_t* space)
}
#endif /* UNIV_DEBUG */

return;
if (!metadata) return;
}

/* Prevent dropping of the space while we are flushing */
Expand Down Expand Up @@ -1030,12 +1029,12 @@ fil_space_extend_must_retry(
*success = os_file_set_size(node->name, node->handle, new_size,
FSP_FLAGS_HAS_PAGE_COMPRESSION(space->flags));


DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28",
*success = FALSE;
os_has_said_disk_full = TRUE;);

if (*success) {
os_file_flush(node->handle);
os_has_said_disk_full = FALSE;
start_page_no = size;
}
Expand Down Expand Up @@ -1063,7 +1062,7 @@ fil_space_extend_must_retry(
= (node->size / pages_per_mb) * pages_per_mb;
}

fil_flush_low(space);
fil_flush_low(space, true);
return(false);
}

Expand Down
4 changes: 4 additions & 0 deletions storage/innobase/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2312,6 +2312,10 @@ innobase_start_or_create_for_mysql()
break;
}

if (stat_info.type != OS_FILE_TYPE_FILE) {
break;
}

if (!srv_file_check_mode(logfilename)) {
return(DB_ERROR);
}
Expand Down
16 changes: 8 additions & 8 deletions storage/xtradb/fil/fil0fil.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2014, 2018, MariaDB Corporation.
Copyright (c) 2014, 2019, MariaDB Corporation.
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
Expand Down Expand Up @@ -846,10 +846,9 @@ fil_try_to_close_file_in_LRU(
}

/** Flush any writes cached by the file system.
@param[in,out] space tablespace */
static
void
fil_flush_low(fil_space_t* space)
@param[in,out] space tablespace
@param[in] metadata whether to update file system metadata */
static void fil_flush_low(fil_space_t* space, bool metadata = false)
{
ut_ad(mutex_own(&fil_system->mutex));
ut_ad(space);
Expand All @@ -873,7 +872,7 @@ fil_flush_low(fil_space_t* space)
}
#endif /* UNIV_DEBUG */

return;
if (!metadata) return;
}

/* Prevent dropping of the space while we are flushing */
Expand Down Expand Up @@ -1037,15 +1036,16 @@ fil_space_extend_must_retry(
*success = os_file_set_size(node->name, node->handle, new_size,
FSP_FLAGS_HAS_PAGE_COMPRESSION(space->flags));


DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28",
*success = FALSE;
os_has_said_disk_full = TRUE;);

if (*success) {
os_file_flush(node->handle);
os_has_said_disk_full = FALSE;
start_page_no = size;
}

mutex_enter(&fil_system->mutex);

ut_a(node->being_extended);
Expand All @@ -1069,7 +1069,7 @@ fil_space_extend_must_retry(
= (node->size / pages_per_mb) * pages_per_mb;
}

fil_flush_low(space);
fil_flush_low(space, true);
return(false);
}

Expand Down
3 changes: 3 additions & 0 deletions storage/xtradb/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2408,6 +2408,9 @@ innobase_start_or_create_for_mysql()
break;
}

if (stat_info.type != OS_FILE_TYPE_FILE) {
break;
}
if (!srv_file_check_mode(logfilename)) {
return(DB_ERROR);
}
Expand Down

0 comments on commit 3b6d2ef

Please sign in to comment.