Commit 547ec8ce authored by Marko Mäkelä's avatar Marko Mäkelä

Do not SET DEBUG_DBUG=-d,... in tests

To disable debug instrumentation, save and restore the original value
of the variable DEBUG_DBUG. Assigning -d,... will enable the output of
a lot of unrelated DBUG messages to the server error log.
parent ee8755e3
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2), create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2),
key k2(f3)) engine=innodb; key k2(f3)) engine=innodb;
insert into t1 values (14, 24, 34); insert into t1 values (14, 24, 34);
set @@debug_dbug = '+d,row_ins_sec_index_entry_timeout'; set @old_dbug= @@session.debug_dbug;
set debug_dbug = '+d,row_ins_sec_index_entry_timeout';
replace into t1 values (14, 25, 34); replace into t1 values (14, 25, 34);
select * from t1; select * from t1;
f1 f2 f3 f1 f2 f3
14 25 34 14 25 34
drop table t1; drop table t1;
set @@debug_dbug = '-d,row_ins_sec_index_entry_timeout'; set debug_dbug = @old_dbug;
set names utf8;
SET UNIQUE_CHECKS=0;
CREATE TABLE corrupt_bit_test_ā(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR(100),
c INT,
z INT,
INDEX idx(b))
ENGINE=InnoDB;
INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1);
CREATE UNIQUE INDEX idxā ON corrupt_bit_test_ā(c, b);
CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b);
SELECT * FROM corrupt_bit_test_ā;
a b c z a b c z
1 x 1 1 1 x 1 1
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
select count(*) from corrupt_bit_test_ā;
count(*) count(*)
2 2
SET @save_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d,dict_set_index_corrupted';
check table corrupt_bit_test_ā;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted
test.corrupt_bit_test_ā check Warning InnoDB: Index "idxā" is marked as corrupted test.corrupt_bit_test_ā check Warning InnoDB: Index "idxā" is marked as corrupted
test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted
test.corrupt_bit_test_ā check error Corrupt test.corrupt_bit_test_ā check error Corrupt
SET debug_dbug = @save_dbug;
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
ERROR HY000: Index corrupt_bit_test_ā is corrupted ERROR HY000: Index corrupt_bit_test_ā is corrupted
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
ERROR HY000: Index corrupt_bit_test_ā is corrupted ERROR HY000: Index corrupt_bit_test_ā is corrupted
select c from corrupt_bit_test_ā;
ERROR HY000: Index corrupt_bit_test_ā is corrupted ERROR HY000: Index corrupt_bit_test_ā is corrupted
select z from corrupt_bit_test_ā;
ERROR HY000: Index corrupt_bit_test_ā is corrupted ERROR HY000: Index corrupt_bit_test_ā is corrupted
show warnings;
Level Code Message Level Code Message
Warning 179 InnoDB: Index "idxē" for table "test"."corrupt_bit_test_ā" is marked as corrupted Warning 179 InnoDB: Index "idxē" for table "test"."corrupt_bit_test_ā" is marked as corrupted
Warning 179 Got error 179 when reading table `test`.`corrupt_bit_test_ā` Warning 179 Got error 179 when reading table `test`.`corrupt_bit_test_ā`
Error 1712 Index corrupt_bit_test_ā is corrupted Error 1712 Index corrupt_bit_test_ā is corrupted
insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
select * from corrupt_bit_test_ā use index(primary) where a = 10001;
a b c z a b c z
10001 a 20001 20001 10001 a 20001 20001
begin;
insert into corrupt_bit_test_ā values (10002, "a", 20002, 20002);
delete from corrupt_bit_test_ā where a = 10001;
insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
rollback;
drop index idxā on corrupt_bit_test_ā;
check table corrupt_bit_test_ā;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted
test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted
test.corrupt_bit_test_ā check error Corrupt test.corrupt_bit_test_ā check error Corrupt
set names utf8;
select z from corrupt_bit_test_ā;
ERROR HY000: Index corrupt_bit_test_ā is corrupted ERROR HY000: Index corrupt_bit_test_ā is corrupted
show create table corrupt_bit_test_ā;
Table Create Table Table Create Table
corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` ( corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` (
`a` int(11) NOT NULL AUTO_INCREMENT, `a` int(11) NOT NULL AUTO_INCREMENT,
...@@ -32,8 +68,12 @@ corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` ( ...@@ -32,8 +68,12 @@ corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` (
UNIQUE KEY `idxē` (`z`,`b`), UNIQUE KEY `idxē` (`z`,`b`),
KEY `idx` (`b`) KEY `idx` (`b`)
) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1 ) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1
drop index idxē on corrupt_bit_test_ā;
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
ERROR HY000: Index corrupt_bit_test_ā is corrupted ERROR HY000: Index corrupt_bit_test_ā is corrupted
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
ERROR HY000: Index corrupt_bit_test_ā is corrupted ERROR HY000: Index corrupt_bit_test_ā is corrupted
show create table corrupt_bit_test_ā;
Table Create Table Table Create Table
corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` ( corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` (
`a` int(11) NOT NULL AUTO_INCREMENT, `a` int(11) NOT NULL AUTO_INCREMENT,
...@@ -43,7 +83,12 @@ corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` ( ...@@ -43,7 +83,12 @@ corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` (
PRIMARY KEY (`a`), PRIMARY KEY (`a`),
KEY `idx` (`b`) KEY `idx` (`b`)
) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1 ) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1
drop index idx on corrupt_bit_test_ā;
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
select z from corrupt_bit_test_ā limit 10;
z z
20001 20001
1 1
2 2
drop table corrupt_bit_test_ā;
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2), create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2),
key k2(f3)) engine=innodb; key k2(f3)) engine=innodb;
insert into t1 values (14, 24, 34); insert into t1 values (14, 24, 34);
set @@debug_dbug = '+d,row_ins_sec_index_entry_timeout'; set @old_dbug= @@session.debug_dbug;
set debug_dbug = '+d,row_ins_sec_index_entry_timeout';
replace into t1 values (14, 25, 34); replace into t1 values (14, 25, 34);
select * from t1; select * from t1;
drop table t1; drop table t1;
set @@debug_dbug = '-d,row_ins_sec_index_entry_timeout'; set debug_dbug = @old_dbug;
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
-- disable_query_log -- disable_query_log
call mtr.add_suppression("Flagged corruption of idx.*in CHECK TABLE"); call mtr.add_suppression("Flagged corruption of idx.*in CHECK TABLE");
-- enable_query_log
set names utf8; set names utf8;
...@@ -36,9 +37,10 @@ INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā; ...@@ -36,9 +37,10 @@ INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
select count(*) from corrupt_bit_test_ā; select count(*) from corrupt_bit_test_ā;
# This will flag all secondary indexes corrupted # This will flag all secondary indexes corrupted
SET SESSION debug_dbug="+d,dict_set_index_corrupted"; SET @save_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d,dict_set_index_corrupted';
check table corrupt_bit_test_ā; check table corrupt_bit_test_ā;
SET SESSION debug_dbug="-d,dict_set_index_corrupted"; SET debug_dbug = @save_dbug;
# Cannot create new indexes while corrupted indexes exist # Cannot create new indexes while corrupted indexes exist
--error ER_INDEX_CORRUPT --error ER_INDEX_CORRUPT
......
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