Debian Codegraph @

mysql-test/suite/innodb/t/blob-crash-4k.test

raw
1 --source include/not_crashrep.inc
2 --source include/have_debug.inc
3
4 --echo #
5 --echo # Bug #16963396 INNODB: USE OF LARGE EXTERNALLY-STORED FIELDS MAKES
6 --echo # CRASH RECOVERY LOSE DATA
7 --echo #
8
9 # ..........................................................................
10
11 --echo #
12 --echo # Uncompressed Table - UPDATE Operation - Crash Test
13 --echo # Update that moves non-updated column to blob
14 --echo #
15
16 create table t2 (f1 bigint primary key, f2 longblob, f3 longblob,
17 index(f2(10), f3(10))) engine=innodb;
18
19 insert into t2 values (1, repeat('%', 1000), repeat('+', 30));
20 select f1, length(f2), length(f3) from t2;
21
22 --echo # Connection con1:
23 connect (con1,localhost,root,,);
24
25 set debug_sync='ib_mv_nonupdated_column_offpage SIGNAL s1 WAIT_FOR go_update';
26
27 # The BLOB update will fail, and should disappear. However no data committed
28 # up to this point should be lost.
29 begin;
30 --send
31 update t2 set f3 = repeat('[', 1000);
32
33 --echo # Connection default:
34 connection default;
35 set debug_sync='now WAIT_FOR s1';
36 set debug_sync='now SIGNAL go_update';
37
38 --echo # Connection con1:
39 connection con1;
40 --echo # reap: update t2 set f3 = repeat('[', 3000);
41 --reap
42
43 --echo # Connection default:
44 connection default;
45
46 --source include/kill_and_restart_mysqld.inc
47
48 select f1, length(f2), length(f3) from t2;
49 select f1, right(f2, 40), right(f3, 40) from t2;
50 check table t2;
51
52 # ..........................................................................
53
54 --echo #
55 --echo # Compressed Table - Update Operation
56 --echo # update that moves a non-updated column to BLOB
57 --echo #
58
59 connection default;
60
61 set global innodb_compression_level = 0;
62
63 create table t3 (f1 bigint primary key, f2 longblob, f3 longblob,
64 index(f2(10), f3(10))) engine=innodb row_format=compressed;
65
66 insert into t3 values (1, repeat('%', 1000), repeat('+', 30));
67 select f1, length(f2), length(f3) from t3;
68
69 --echo # Connection con2:
70 connect (con2,localhost,root,,);
71 set debug_sync='ib_mv_nonupdated_column_offpage SIGNAL s1 WAIT_FOR go_upd';
72
73 # The BLOB update will fail, and should disappear. However no data committed
74 # up to this point should be lost.
75 begin;
76 --send
77 update t3 set f3 = repeat(']', 1000) where f1 = 1;
78
79 --echo # Connection default:
80 connection default;
81 set debug_sync='now WAIT_FOR s1';
82 set debug_sync='now SIGNAL go_upd';
83
84 --echo # Connection con2:
85 connection con2;
86 --echo # reap: update t3 set f3 = repeat(']', 1000) where f1 = 1;
87 --reap
88
89 --echo # Connection default:
90 connection default;
91
92 --source include/kill_and_restart_mysqld.inc
93
94 select f1, length(f2), length(f3) from t3;
95 select f1, right(f2, 30), right(f3, 20) from t3;
96 check table t3;
97
98 # ..........................................................................
99
100 # Clean up.
101 DROP TABLE t2, t3;