create table t1 (a int primary key, utf_t text character set utf8mb4, tb tinyblob, b blob, mb mediumblob, lb longblob, tt tinytext, t text, mt mediumtext, lt longtext) engine=ndb; insert into t1 values (1, REPEAT("A",5000), REPEAT("A",255), REPEAT("A",5000), REPEAT("A",65536), REPEAT("A", 30000), REPEAT("A",255), REPEAT("A",5000), REPEAT("A",65536), REPEAT("A", 30000)); insert into t1 values (2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); insert into t1 values (3, "", "", "", "", "", "", "", "", ""); insert into t1 values (4, REPEAT("a%d4 ",51), REPEAT("a%d4 ",51), REPEAT("a%d4 ",1000), REPEAT("a%d4 ",2000), REPEAT("a%d4 ", 6000), REPEAT("a%d4 ",51), REPEAT("a%d4 ",1000), REPEAT("a%d4 ",2000), REPEAT("a%d4 ", 6000)); insert into t1 values (5, "less_than_inline_len", "less_than_inline_len", "less_than_inline_len", "less_than_inline_len", "less_than_inline_len", "less_than_inline_len", "less_than_inline_len", "less_than_inline_len", "less_than_inline_len"); insert into t1 values (6, REPEAT(" ",1000), REPEAT(" ",51), REPEAT(" ",1000), REPEAT(" ",2000), REPEAT(" ", 6000), REPEAT(" ",51), REPEAT(" ",1000), REPEAT(" ",2000), REPEAT(" ", 6000)); insert into t1 values (7, REPEAT(" -,.;",1000), REPEAT(" -,.;",51), REPEAT(" -,.;",1000), REPEAT(" -,.;",2000), REPEAT(" -,.;", 6000), REPEAT(" -,.;",51), REPEAT(" -,.;",1000), REPEAT(" -,.;",2001), REPEAT(" -,.;", 6000)); insert into t1 values (8, REPEAT("12345",1000), REPEAT("12345",51), REPEAT("12345",1000), REPEAT("12345",2000), REPEAT("12345", 6000), REPEAT("12345",51), REPEAT("12345",1000), REPEAT("12345",2001), REPEAT("12345", 6000)); insert into t1 values (9, REPEAT("abcde",1000), REPEAT("abcde",51), REPEAT("abcde",1000), REPEAT("abcde",2000), REPEAT("abcde", 6000), REPEAT("abcde",51), REPEAT("abcde",1000), REPEAT("abcde",2001), REPEAT("abcde", 6000)); insert into t1 values (10, REPEAT("ABCDE",1000), REPEAT("ABCDE",51), REPEAT("ABCDE",1000), REPEAT("ABCDE",2000), REPEAT("ABCDE", 6000), REPEAT("ABCDE",51), REPEAT("ABCDE",1000), REPEAT("ABCDE",2001), REPEAT("ABCDE", 6000)); insert into t1 select a+10, utf_t, tb, b, mb, lb, tt, t, mt, lt from t1; insert into t1 select a+20, utf_t, tb, b, mb, lb, tt, t, mt, lt from t1; # run backup truncate table t1; # run broken restore of data select count(1) into @count_parent_rows_before from t1; Observe "blob corruption error" failures on queries Fully ordered OI scan select * from test.t1 order by a; ERROR HY000: Got error 4267 'Corrupted blob value' from NDBCLUSTER show warnings limit 1; Level Code Message Warning 1296 Got error 4267 'Corrupted blob value' from NDB Fully ordered OI scan, different first tuple select * from test.t1 order by a desc; ERROR HY000: Got error 4267 'Corrupted blob value' from NDBCLUSTER show warnings limit 1; Level Code Message Warning 1296 Got error 4267 'Corrupted blob value' from NDB OI scan select * from test.t1 where a > 0; ERROR HY000: Got error 4267 'Corrupted blob value' from NDBCLUSTER show warnings limit 1; Level Code Message Warning 1296 Got error 4267 'Corrupted blob value' from NDB OI scan, different first tuple select * from test.t1 where a < 6; ERROR HY000: Got error 4267 'Corrupted blob value' from NDBCLUSTER show warnings limit 1; Level Code Message Warning 1296 Got error 4267 'Corrupted blob value' from NDB Table scan select * from test.t1; ERROR HY000: Got error 4267 'Corrupted blob value' from NDBCLUSTER show warnings limit 1; Level Code Message Warning 1296 Got error 4267 'Corrupted blob value' from NDB ndb_blob_tool errors out on finding missing blob parts Add in missing parts Verify that there are no missing parts or orphan rows Show that data read is not an empty set select count(1) into @count_parent_rows_after from t1; select sum(a) > 0, sum(utf_t) > 0, sum(tb) > 0, sum(b) > 0, sum(mb) > 0, sum(lb) > 0, sum(tt) > 0, sum(t) > 0, sum(mt) > 0, sum(lt) > 0 from t1; sum(a) > 0 sum(utf_t) > 0 sum(tb) > 0 sum(b) > 0 sum(mb) > 0 sum(lb) > 0 sum(tt) > 0 sum(t) > 0 sum(mt) > 0 sum(lt) > 0 1 1 1 1 1 1 1 1 1 1 select @count_parent_rows_before >= @count_parent_rows_after; @count_parent_rows_before >= @count_parent_rows_after 1 select @count_parent_rows_after > 0; @count_parent_rows_after > 0 1 drop table t1; Verify that blob deletes with scans handle pending blob writes correctly create table t1 (pk bigint unsigned auto_increment primary key , blob_col TEXT)engine=ndbcluster; create table t2 (pk bigint unsigned auto_increment primary key , varchar_col varchar(100), virtual_blob_col TEXT as (REPEAT(varchar_col,40)) VIRTUAL)engine=ndbcluster; insert into t1 (pk, blob_col) values(NULL,NULL); insert into t1 select NULL, NULL from t1; insert into t1 select NULL, NULL from t1; insert into t1 select NULL, NULL from t1; insert into t1 select NULL, NULL from t1; insert into t2 (pk, varchar_col) select pk, blob_col from t1; update t1 set blob_col = repeat('mysql', 2000) limit 8; update t2 set varchar_col = repeat('mysql', 20) limit 8; set ndb_blob_write_batch_bytes=0; set ndb_blob_read_batch_bytes=0; create table ndb_blob_corrupt_temp_table(pk varchar(10) primary key, exec_count_serialised int, exec_count_batched int)engine=ndb; insert into ndb_blob_corrupt_temp_table values ("DELETE", 0, 0), ("UPDATE", 0, 0); update with blob column in WHERE clause update t1 set blob_col = repeat('mysql', 400) where blob_col like '%mysql%'; update with virtual blob column in WHERE clause update t2 set varchar_col = repeat('mysql', 10) where virtual_blob_col like '%mysql%'; delete with blob column in WHERE clause delete from t1 where blob_col is NOT NULL; delete with virtual blob column in WHERE clause delete from t2 where virtual_blob_col is NOT NULL; select exec_count_serialised > exec_count_batched from ndb_blob_corrupt_temp_table; exec_count_serialised > exec_count_batched 1 1 drop table ndb_blob_corrupt_temp_table; drop table t1; drop table t2;