File: handle_data_event_fail.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (73 lines) | stat: -rw-r--r-- 2,217 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
--source include/have_ndb.inc
# Test requires debug compiled mysqld
--source include/have_debug.inc

--echo #
--echo # Bug#32469090 FAILURE TO FIND BLOBPARTS NOT HANDLED
--echo # - Use DBUG to insert error while processing INSERT, UPDATE
--echo #   and DELETE events on a table with blobs. The binlog thread will
--echo #   restart and write a LOST_EVENTS to the binlog.
--echo #

# Supress error log messages triggered by test
--disable_query_log
call mtr.add_suppression("incident event has been written");
call mtr.add_suppression("test.check_not_readonly");
--enable_query_log

CREATE TABLE t1 (
  a int primary key,
  b blob,
  c text
) ENGINE = NDB;

let $loop = 0;
while($loop < 3)
{
  # Clear the binlog to make it easy to check for LOST_EVENTS
  RESET MASTER;

  set @save_debug = @@global.debug;
  set @@global.debug = '+d,ndb_event_fail_read_blob_parts';

  --echo # Create and drop dummy table to activate DBUG in binlog thread
  CREATE TABLE dummy (a int primary key) ENGINE = NDB;
  DROP TABLE dummy;

  if ($loop == 0)
  {
    --echo # Perform INSERT with blob large enough to trigger reading
    --echo # blob parts and thus event will fail to be processed
    eval INSERT INTO t1 VALUES (37, REPEAT("MySQL", 256),
                                    REPEAT("Cluster", 1024));
  }

  if ($loop == 1)
  {
    --echo # Perform UPDATE with blob large enough to trigger reading
    --echo # blob parts and thus event will fail to be processed
    eval UPDATE t1 SET b = REPEAT("NDB", 256*$loop),
                       c = REPEAT("MySQL", 1024*$loop) WHERE a = 37;
  }

  if ($loop == 2)
  {
    --echo # Perform DELETE. The blob in NDB is large but only primary keys
    --echo # are needed so blob parts are not read. It is possible to configure
    --echo # "full image" to be logged, but that is not enabled in this test.
    DELETE FROM t1 WHERE a = 37;
  }

  --echo # mysqld1: Wait until ready again...
  --source include/ndb_not_readonly.inc

  set @@global.debug = @save_debug;

  --echo # Check that LOST_EVENTS event was written to the binlog for
  --echo # INSERT and UPDATE. The DELETE should have a normal log entry.
  --source include/show_binlog_events.inc

  inc $loop;
}

DROP TABLE t1;