summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r/innodb_corrupt_bit.result
blob: daf0345e8caf04a7c91737b4ed4bf7caf60e2d3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
set names utf8;
CREATE TABLE corrupt_bit_test_ā(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR(100),
c INT,
z INT,
INDEX idx(b))
ENGINE=InnoDB STATS_PERSISTENT=0;
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
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(*)
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
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
SET @@SESSION.debug_dbug = @save_dbug;
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
ERROR HY000: Index idx is corrupted
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
ERROR HY000: Index idx is corrupted
select c from corrupt_bit_test_ā;
ERROR HY000: Index corrupt_bit_test_ā is corrupted
select z from corrupt_bit_test_ā;
ERROR HY000: Index corrupt_bit_test_ā is corrupted
show warnings;
Level	Code	Message
Warning	180	InnoDB: Index idxē for table `test`.`corrupt_bit_test_ā` is marked as 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
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
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
set names utf8;
select z from corrupt_bit_test_ā;
ERROR HY000: Index corrupt_bit_test_ā is corrupted
drop index idxē on corrupt_bit_test_ā;
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
ERROR HY000: Index idx is corrupted
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
ERROR HY000: Index idx is corrupted
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
20001
1
2
drop table corrupt_bit_test_ā;