summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test/rocksdb/r/corrupted_data_reads_debug.result
blob: 47f7bb923bab86661ea47db4055cb7d46f2ba245 (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
72
73
74
#
#  Test how MyRocks handles reading corrupted data from disk.
#  Data corruption is simulated at source-code level.
#
#
#  A test for case when data in the table *record* is longer
#  than table DDL expects it to be
#
create table t1 (
pk int not null primary key,
col1 varchar(10)
) engine=rocksdb;
insert into t1 values (1,1),(2,2),(3,3);
select * from t1;
pk	col1
1	1
2	2
3	3
set @tmp1=@@rocksdb_verify_row_debug_checksums;
set rocksdb_verify_row_debug_checksums=1;
set session debug_dbug= "+d,myrocks_simulate_bad_row_read1";
select * from t1 where pk=1;
ERROR HY000: Got error 202 'Found data corruption.' from ROCKSDB
set session debug_dbug= "-d,myrocks_simulate_bad_row_read1";
set rocksdb_verify_row_debug_checksums=@tmp1;
select * from t1 where pk=1;
pk	col1
1	1
set session debug_dbug= "+d,myrocks_simulate_bad_row_read2";
select * from t1 where pk=1;
ERROR HY000: Got error 202 'Found data corruption.' from ROCKSDB
set session debug_dbug= "-d,myrocks_simulate_bad_row_read2";
set session debug_dbug= "+d,myrocks_simulate_bad_row_read3";
select * from t1 where pk=1;
ERROR HY000: Got error 202 'Found data corruption.' from ROCKSDB
set session debug_dbug= "-d,myrocks_simulate_bad_row_read3";
insert into t1 values(4,'0123456789');
select * from t1;
pk	col1
1	1
2	2
3	3
4	0123456789
drop table t1;
#
#  A test for case when index data is longer than table DDL
#  expects it to be
#
create table t2 (
pk varchar(4) not null primary key,
col1 int not null
) engine=rocksdb collate latin1_bin;
insert into t2 values ('ABCD',1);
select * from t2;
pk	col1
ABCD	1
set session debug_dbug= "+d,myrocks_simulate_bad_pk_read1";
select * from t2;
ERROR HY000: Got error 202 'Found data corruption.' from ROCKSDB
set session debug_dbug= "-d,myrocks_simulate_bad_pk_read1";
drop table t2;
create table t2 (
pk varchar(4) not null primary key,
col1 int not null
) engine=rocksdb;
insert into t2 values ('ABCD',1);
select * from t2;
pk	col1
ABCD	1
set session debug_dbug= "+d,myrocks_simulate_bad_pk_read1";
select * from t2;
ERROR HY000: Got error 202 'Found data corruption.' from ROCKSDB
set session debug_dbug= "-d,myrocks_simulate_bad_pk_read1";
drop table t2;