Commit 3294f6c3 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-14085 Merge new release of InnoDB MySQL 5.7.20 to 10.2

parents 3bc094d3 59d3ba0b
#
# Bug#25053705 - INVALID I/O ON TABLE AFTER TRUNCATE
#
CREATE TABLE t1 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b),
FULLTEXT fts2(c));
TRUNCATE TABLE t1;
INSERT INTO t1 (a,d,b,c) VALUES (
'79795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc
cuullucocraloracurooulrooauuar','1'));
CREATE TABLE t2 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b));
INSERT INTO t2 VALUES (1, 1, repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorccuullucocraloracurooulrooauuar','1'));
create procedure insert_t2(IN total int)
begin
declare i int default 1;
while (i <= total) DO
insert into t2 select * from t2;
set i = i + 1;
end while;
end|
CALL insert_t2(15);
SET @save_dbug = @@SESSION.DEBUG_DBUG;
SET DEBUG_DBUG = '+d,innodb_invalid_read_after_truncate';
INSERT INTO t1 (a,d,b,c) VALUES (
'7795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc
cuullucocraloracurooulrooauuar','1'));
SET DEBUG_DBUG = @save_dbug;
DROP PROCEDURE insert_t2;
DROP TABLE t1,t2;
--source include/have_innodb.inc
--source include/have_debug.inc
--echo #
--echo # Bug#25053705 - INVALID I/O ON TABLE AFTER TRUNCATE
--echo #
CREATE TABLE t1 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b),
FULLTEXT fts2(c));
TRUNCATE TABLE t1;
INSERT INTO t1 (a,d,b,c) VALUES (
'79795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc
cuullucocraloracurooulrooauuar','1'));
# The following CREATE TABLE and INSERTs are used to remove the pages related to table t1
# from the buffer pool.
CREATE TABLE t2 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b));
INSERT INTO t2 VALUES (1, 1, repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorccuullucocraloracurooulrooauuar','1'));
delimiter |;
create procedure insert_t2(IN total int)
begin
declare i int default 1;
while (i <= total) DO
insert into t2 select * from t2;
set i = i + 1;
end while;
end|
delimiter ;|
CALL insert_t2(15);
SET @save_dbug = @@SESSION.DEBUG_DBUG;
SET DEBUG_DBUG = '+d,innodb_invalid_read_after_truncate';
INSERT INTO t1 (a,d,b,c) VALUES (
'7795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc
cuullucocraloracurooulrooauuar','1'));
SET DEBUG_DBUG = @save_dbug;
DROP PROCEDURE insert_t2;
DROP TABLE t1,t2;
......@@ -3046,7 +3046,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_VERSION
SESSION_VALUE NULL
GLOBAL_VALUE 5.7.19
GLOBAL_VALUE 5.7.20
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
......
......@@ -176,6 +176,17 @@ buf_read_page_low(
dst = ((buf_block_t*) bpage)->frame;
}
DBUG_EXECUTE_IF(
"innodb_invalid_read_after_truncate",
if (fil_space_t* space = fil_space_acquire(page_id.space())) {
if (!strcmp(space->name, "test/t1")
&& page_id.page_no() == space->size - 1) {
type = 0;
sync = true;
}
fil_space_release(space);
});
IORequest request(type | IORequest::READ);
*err = fil_io(
......@@ -321,6 +332,19 @@ buf_read_ahead_random(
that is, reside near the start of the LRU list. */
for (i = low; i < high; i++) {
DBUG_EXECUTE_IF(
"innodb_invalid_read_after_truncate",
if (fil_space_t* space = fil_space_acquire(
page_id.space())) {
bool skip = !strcmp(space->name, "test/t1");
fil_space_release(space);
if (skip) {
high = space->size;
buf_pool_mutex_exit(buf_pool);
goto read_ahead;
}
});
const buf_page_t* bpage = buf_page_hash_get(
buf_pool, page_id_t(page_id.space(), i));
......
......@@ -41,7 +41,7 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 5
#define INNODB_VERSION_MINOR 7
#define INNODB_VERSION_BUGFIX 19
#define INNODB_VERSION_BUGFIX 20
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
......
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