| 1 |
--source include/have_ndb.inc |
| 2 |
# Test requires debug compiled mysqld |
| 3 |
--source include/have_debug.inc |
| 4 |
|
| 5 |
--echo # |
| 6 |
--echo # Bug#32469090 FAILURE TO FIND BLOBPARTS NOT HANDLED |
| 7 |
--echo # - Use DBUG to insert error while processing INSERT, UPDATE |
| 8 |
--echo # and DELETE events on a table with blobs. The binlog thread will |
| 9 |
--echo # restart and write a LOST_EVENTS to the binlog. |
| 10 |
--echo # |
| 11 |
|
| 12 |
# Supress error log messages triggered by test |
| 13 |
--disable_query_log |
| 14 |
call mtr.add_suppression("incident event has been written"); |
| 15 |
call mtr.add_suppression("test.check_not_readonly"); |
| 16 |
--enable_query_log |
| 17 |
|
| 18 |
CREATE TABLE t1 ( |
| 19 |
a int primary key, |
| 20 |
b blob, |
| 21 |
c text |
| 22 |
) ENGINE = NDB; |
| 23 |
|
| 24 |
let $loop = 0; |
| 25 |
while($loop < 3) |
| 26 |
{ |
| 27 |
# Clear the binlog to make it easy to check for LOST_EVENTS |
| 28 |
RESET MASTER; |
| 29 |
|
| 30 |
set @save_debug = @@global.debug; |
| 31 |
set @@global.debug = '+d,ndb_event_fail_read_blob_parts'; |
| 32 |
|
| 33 |
--echo # Create and drop dummy table to activate DBUG in binlog thread |
| 34 |
CREATE TABLE dummy (a int primary key) ENGINE = NDB; |
| 35 |
DROP TABLE dummy; |
| 36 |
|
| 37 |
if ($loop == 0) |
| 38 |
{ |
| 39 |
--echo # Perform INSERT with blob large enough to trigger reading |
| 40 |
--echo # blob parts and thus event will fail to be processed |
| 41 |
eval INSERT INTO t1 VALUES (37, REPEAT("MySQL", 256), |
| 42 |
REPEAT("Cluster", 1024)); |
| 43 |
} |
| 44 |
|
| 45 |
if ($loop == 1) |
| 46 |
{ |
| 47 |
--echo # Perform UPDATE with blob large enough to trigger reading |
| 48 |
--echo # blob parts and thus event will fail to be processed |
| 49 |
eval UPDATE t1 SET b = REPEAT("NDB", 256*$loop), |
| 50 |
c = REPEAT("MySQL", 1024*$loop) WHERE a = 37; |
| 51 |
} |
| 52 |
|
| 53 |
if ($loop == 2) |
| 54 |
{ |
| 55 |
--echo # Perform DELETE. The blob in NDB is large but only primary keys |
| 56 |
--echo # are needed so blob parts are not read. It is possible to configure |
| 57 |
--echo # "full image" to be logged, but that is not enabled in this test. |
| 58 |
DELETE FROM t1 WHERE a = 37; |
| 59 |
} |
| 60 |
|
| 61 |
--echo # mysqld1: Wait until ready again... |
| 62 |
--source include/ndb_not_readonly.inc |
| 63 |
|
| 64 |
set @@global.debug = @save_debug; |
| 65 |
|
| 66 |
--echo # Check that LOST_EVENTS event was written to the binlog for |
| 67 |
--echo # INSERT and UPDATE. The DELETE should have a normal log entry. |
| 68 |
--source include/show_binlog_events.inc |
| 69 |
|
| 70 |
inc $loop; |
| 71 |
} |
| 72 |
|
| 73 |
DROP TABLE t1; |