Commit 59d3ba0b authored by Marko Mäkelä's avatar Marko Mäkelä

Adjust the instrumentation and test

parent 7c9651a3
--source include/have_innodb.inc
#
# MDEV-11995 ALTER TABLE proceeds despite reporting ER_TOO_LONG_KEY error
#
set @@sql_mode=strict_trans_tables;
create table t1(a text not null) row_format=dynamic engine=innodb;
create index idx1 on t1(a(3073));
show create table t1;
drop table t1;
set @@sql_mode=default;
CREATE TABLE t1 (
id1 INT AUTO_INCREMENT PRIMARY KEY, id2 VARCHAR(30) NOT NULL UNIQUE,
id3 DATETIME
) ENGINE=InnoDB;
ALTER TABLE t1 CHANGE COLUMN id2 id4 VARCHAR(40) NOT NULL;
SELECT * FROM t1 WHERE id4 LIKE 'a';
DROP TABLE t1;
......@@ -20,12 +20,12 @@ set i = i + 1;
end while;
end|
CALL insert_t2(15);
SET SESSION debug="+d,innodb_invalid_read_after_truncate";
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 SESSION debug="-d,innodb_invalid_read_after_truncate";
SET DEBUG_DBUG = @save_dbug;
DROP PROCEDURE insert_t2;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t1,t2;
--source include/have_innodb_64k.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--echo #
......@@ -35,16 +35,16 @@ delimiter ;|
CALL insert_t2(15);
SET SESSION debug="+d,innodb_invalid_read_after_truncate";
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 SESSION debug="-d,innodb_invalid_read_after_truncate";
SET DEBUG_DBUG = @save_dbug;
DROP PROCEDURE insert_t2;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t1,t2;
......@@ -176,17 +176,16 @@ buf_read_page_low(
dst = ((buf_block_t*) bpage)->frame;
}
/* This debug code is only for 5.7. In trunk, with newDD,
the space->name is no longer same as table name. */
DBUG_EXECUTE_IF("innodb_invalid_read_after_truncate",
fil_space_t* space = fil_space_get(page_id.space());
if (space != NULL && strcmp(space->name, "test/t1") == 0
&& page_id.page_no() == space->size - 1) {
type = IORequest::READ;
sync = true;
}
);
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);
......@@ -333,18 +332,18 @@ buf_read_ahead_random(
that is, reside near the start of the LRU list. */
for (i = low; i < high; i++) {
/* This debug code is only for 5.7. In trunk, with newDD,
the space->name is no longer same as table name. */
DBUG_EXECUTE_IF("innodb_invalid_read_after_truncate",
fil_space_t* space = fil_space_get(page_id.space());
if (space != NULL
&& strcmp(space->name, "test/t1") == 0) {
high = space->size;
buf_pool_mutex_exit(buf_pool);
goto read_ahead;
}
);
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));
......
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