File: ndb_binlog_table_map_log.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 (67 lines) | stat: -rw-r--r-- 2,497 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
--source include/have_debug.inc
--source include/have_ndb.inc
--source include/have_multi_ndb.inc

# The "last_epoch" counter need to be reset after test to support --repeat
--source include/force_restart.inc

--echo ######################################################################
--echo # Bug#35199996 table map entry for certain table were logged in to the
--echo # binlogs even though the log_replica_updates is disabled
--echo ######################################################################
#
# Before a Table_map event is injected in the Binlog, there are some
# checks that need to be performed. One of these relies on a filtered
# any-value, which is calculated from the accumulation of the
# any-value on every event for a given table. The unfiltered value can
# contain an indication that a change is not to be logged (no logging
# bit) or that it comes from a replica (non zero server id).
#
# This test makes the Binlog injector to run a self-test functionality
# that essentially creates a transaction against a NDB table, setting
# up specific any-values. These any-values range from no logging bits
# to server ids (mimicking replicas) that are inversed from one
# another. Then it exports the generated Binlog, deletes the data and
# imports once again.

CREATE TABLE test_log_table_maps (id INT PRIMARY KEY, what VARCHAR(128)) ENGINE = NDB;
SET @save_debug= @@GLOBAL.debug;
SET @@GLOBAL.debug="+d,ndb_binlog_log_table_maps";

# Wait for dbug_log_table_maps to complete writing data to the table
--let $ROWS = 16
while (`SELECT COUNT(*) < $ROWS FROM test_log_table_maps`) {
  sleep 0.1;
}

SET @@GLOBAL.debug= @save_debug;

# Make sure we have logged everything up to date
--save_master_pos

--echo # Show data written
SELECT * FROM test_log_table_maps ORDER BY id;

--source include/show_binlog_events.inc

--echo # Verify server1 Binlog changes
--echo # Some rows are not logged because no-logging bit was set
--let $table_name= test_log_table_maps
--let $order_by= id
--source ndb_binlog_verify_table.inc

--echo [connection server2]
--connection server2
# Make sure we have logged everything up to date
--save_master_pos
--source include/show_binlog_events.inc

--echo # Verify server2 Binlog changes
--echo # Additional rows are not logged because server2 does NOT log replica updates
--let $table_name= test_log_table_maps
--let $order_by= id
--source ndb_binlog_verify_table.inc

--echo [connection server1]
--connection server1
DROP TABLE test_log_table_maps;