1#
2# Bug #16963396 INNODB: USE OF LARGE EXTERNALLY-STORED FIELDS MAKES
3# CRASH RECOVERY LOSE DATA
4#
5#
6# Uncompressed Table - UPDATE Operation - Crash Test
7# Update that moves non-updated column to blob
8#
9create table t2 (f1 bigint primary key, f2 longblob, f3 longblob,
10index(f2(10), f3(10))) engine=innodb;
11insert into t2 values (1, repeat('%', 1000), repeat('+', 30));
12select f1, length(f2), length(f3) from t2;
13f1	length(f2)	length(f3)
141	1000	30
15# Connection con1:
16set debug_sync='ib_mv_nonupdated_column_offpage SIGNAL s1 WAIT_FOR go_update';
17begin;
18update t2 set f3 = repeat('[', 1000);
19# Connection default:
20set debug_sync='now WAIT_FOR s1';
21set debug_sync='now SIGNAL go_update';
22# Connection con1:
23# reap: update t2 set f3 = repeat('[', 3000);
24# Connection default:
25# Kill and restart
26select f1, length(f2), length(f3) from t2;
27f1	length(f2)	length(f3)
281	1000	30
29select f1, right(f2, 40), right(f3, 40) from t2;
30f1	right(f2, 40)	right(f3, 40)
311	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%	++++++++++++++++++++++++++++++
32check table t2;
33Table	Op	Msg_type	Msg_text
34test.t2	check	status	OK
35#
36# Compressed Table - Update Operation
37# update that moves a non-updated column to BLOB
38#
39set global innodb_compression_level = 0;
40create table t3 (f1 bigint primary key, f2 longblob, f3 longblob,
41index(f2(10), f3(10))) engine=innodb row_format=compressed;
42insert into t3 values (1, repeat('%', 1000), repeat('+', 30));
43select f1, length(f2), length(f3) from t3;
44f1	length(f2)	length(f3)
451	1000	30
46# Connection con2:
47set debug_sync='ib_mv_nonupdated_column_offpage SIGNAL s1 WAIT_FOR go_upd';
48begin;
49update t3 set f3 = repeat(']', 1000) where f1 = 1;
50# Connection default:
51set debug_sync='now WAIT_FOR s1';
52set debug_sync='now SIGNAL go_upd';
53# Connection con2:
54# reap: update t3 set f3 = repeat(']', 1000) where f1 = 1;
55# Connection default:
56# Kill and restart
57select f1, length(f2), length(f3) from t3;
58f1	length(f2)	length(f3)
591	1000	30
60select f1, right(f2, 30), right(f3, 20) from t3;
61f1	right(f2, 30)	right(f3, 20)
621	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%	++++++++++++++++++++
63check table t3;
64Table	Op	Msg_type	Msg_text
65test.t3	check	status	OK
66DROP TABLE t2, t3;
67