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

Adjust the instrumentation and test

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