| 1 |
# |
| 2 |
# Bug#32469090 FAILURE TO FIND BLOBPARTS NOT HANDLED |
| 3 |
# - Use DBUG to insert error while processing INSERT, UPDATE |
| 4 |
# and DELETE events on a table with blobs. The binlog thread will |
| 5 |
# restart and write a LOST_EVENTS to the binlog. |
| 6 |
# |
| 7 |
CREATE TABLE t1 ( |
| 8 |
a int primary key, |
| 9 |
b blob, |
| 10 |
c text |
| 11 |
) ENGINE = NDB; |
| 12 |
RESET MASTER; |
| 13 |
set @save_debug = @@global.debug; |
| 14 |
set @@global.debug = '+d,ndb_event_fail_read_blob_parts'; |
| 15 |
# Create and drop dummy table to activate DBUG in binlog thread |
| 16 |
CREATE TABLE dummy (a int primary key) ENGINE = NDB; |
| 17 |
DROP TABLE dummy; |
| 18 |
# Perform INSERT with blob large enough to trigger reading |
| 19 |
# blob parts and thus event will fail to be processed |
| 20 |
INSERT INTO t1 VALUES (37, REPEAT("MySQL", 256), |
| 21 |
REPEAT("Cluster", 1024)); |
| 22 |
# mysqld1: Wait until ready again... |
| 23 |
set @@global.debug = @save_debug; |
| 24 |
# Check that LOST_EVENTS event was written to the binlog for |
| 25 |
# INSERT and UPDATE. The DELETE should have a normal log entry. |
| 26 |
include/show_binlog_events.inc |
| 27 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 28 |
binlog.000001 # Query # # use `test`; CREATE TABLE dummy (a int primary key) ENGINE = NDB |
| 29 |
binlog.000001 # Query # # use `test`; DROP TABLE `dummy` /* generated by server */ |
| 30 |
binlog.000001 # Incident # # #1 (LOST_EVENTS) |
| 31 |
binlog.000001 # Rotate # # binlog.000002;pos=POS |
| 32 |
RESET MASTER; |
| 33 |
set @save_debug = @@global.debug; |
| 34 |
set @@global.debug = '+d,ndb_event_fail_read_blob_parts'; |
| 35 |
# Create and drop dummy table to activate DBUG in binlog thread |
| 36 |
CREATE TABLE dummy (a int primary key) ENGINE = NDB; |
| 37 |
DROP TABLE dummy; |
| 38 |
# Perform UPDATE with blob large enough to trigger reading |
| 39 |
# blob parts and thus event will fail to be processed |
| 40 |
UPDATE t1 SET b = REPEAT("NDB", 256*1), |
| 41 |
c = REPEAT("MySQL", 1024*1) WHERE a = 37; |
| 42 |
# mysqld1: Wait until ready again... |
| 43 |
set @@global.debug = @save_debug; |
| 44 |
# Check that LOST_EVENTS event was written to the binlog for |
| 45 |
# INSERT and UPDATE. The DELETE should have a normal log entry. |
| 46 |
include/show_binlog_events.inc |
| 47 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 48 |
binlog.000001 # Query # # use `test`; CREATE TABLE dummy (a int primary key) ENGINE = NDB |
| 49 |
binlog.000001 # Query # # use `test`; DROP TABLE `dummy` /* generated by server */ |
| 50 |
binlog.000001 # Incident # # #1 (LOST_EVENTS) |
| 51 |
binlog.000001 # Rotate # # binlog.000002;pos=POS |
| 52 |
RESET MASTER; |
| 53 |
set @save_debug = @@global.debug; |
| 54 |
set @@global.debug = '+d,ndb_event_fail_read_blob_parts'; |
| 55 |
# Create and drop dummy table to activate DBUG in binlog thread |
| 56 |
CREATE TABLE dummy (a int primary key) ENGINE = NDB; |
| 57 |
DROP TABLE dummy; |
| 58 |
# Perform DELETE. The blob in NDB is large but only primary keys |
| 59 |
# are needed so blob parts are not read. It is possible to configure |
| 60 |
# "full image" to be logged, but that is not enabled in this test. |
| 61 |
DELETE FROM t1 WHERE a = 37; |
| 62 |
# mysqld1: Wait until ready again... |
| 63 |
set @@global.debug = @save_debug; |
| 64 |
# Check that LOST_EVENTS event was written to the binlog for |
| 65 |
# INSERT and UPDATE. The DELETE should have a normal log entry. |
| 66 |
include/show_binlog_events.inc |
| 67 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 68 |
binlog.000001 # Query # # use `test`; CREATE TABLE dummy (a int primary key) ENGINE = NDB |
| 69 |
binlog.000001 # Query # # use `test`; DROP TABLE `dummy` /* generated by server */ |
| 70 |
binlog.000001 # Query # # BEGIN |
| 71 |
binlog.000001 # Table_map # # table_id: # (test.t1) |
| 72 |
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) |
| 73 |
binlog.000001 # Write_rows # # table_id: # |
| 74 |
binlog.000001 # Delete_rows # # table_id: # flags: STMT_END_F |
| 75 |
binlog.000001 # Query # # COMMIT |
| 76 |
DROP TABLE t1; |