| 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('%', 7000), 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('[', 3000); |
| 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 |
set global innodb_compression_level = 0; |
| 60 |
|
| 61 |
create table t3 (f1 bigint primary key, f2 longblob, f3 longblob, |
| 62 |
index(f2(10), f3(10))) engine=innodb row_format=compressed; |
| 63 |
|
| 64 |
insert into t3 values (1, repeat('%', 7000), repeat('+', 30)); |
| 65 |
select f1, length(f2), length(f3) from t3; |
| 66 |
|
| 67 |
--echo # Connection con2: |
| 68 |
connect (con2,localhost,root,,); |
| 69 |
set debug_sync='ib_mv_nonupdated_column_offpage SIGNAL s1 WAIT_FOR go_upd'; |
| 70 |
|
| 71 |
# The BLOB update will fail, and should disappear. However no data committed |
| 72 |
# up to this point should be lost. |
| 73 |
begin; |
| 74 |
--send update t3 set f3 = repeat('[', 3000) where f1 = 1; |
| 75 |
|
| 76 |
--echo # Connection default: |
| 77 |
connection default; |
| 78 |
set debug_sync='now WAIT_FOR s1'; |
| 79 |
set debug_sync='now SIGNAL go_upd'; |
| 80 |
|
| 81 |
--echo # Connection con2: |
| 82 |
connection con2; |
| 83 |
--echo # reap: update t3 set f3 = repeat('[', 3000) where f1 = 1; |
| 84 |
--reap |
| 85 |
|
| 86 |
--echo # Connection default: |
| 87 |
connection default; |
| 88 |
|
| 89 |
--source include/kill_and_restart_mysqld.inc |
| 90 |
|
| 91 |
select f1, length(f2), length(f3) from t3; |
| 92 |
select f1, right(f2, 30), right(f3, 20) from t3; |
| 93 |
check table t3; |
| 94 |
|
| 95 |
# Clean up. |
| 96 |
DROP TABLE t2, t3; |
| 97 |
|