File: rpl_replication_observers_example_plugin_io.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 (106 lines) | stat: -rw-r--r-- 4,014 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#
# The purpose of this test is to demonstrate the capabilities of the
# Replication Observers example plugin and to assess its correct functionality
#
# The plugin is only loaded on slave server to capture relay log notifications.
#
# Since one wants to test only the hook execution in place, a test
# plugin was created to serve those needs. The plugin will print once
# if the hook method is executed and the test will verify if the hook
# was called.
#
# This test will use the hooks related with Event control and SQL/IO
# thread handling.
# - after_reset_slave: Called after a RESET SLAVE is invoked
# - thread_start: Called when the IO Thread starts
# - before_request_transmit: Called before the slave requests the events
#                            from a master.
# - after_read_event: Called after an event is received.
# - after_queue_event: Called after an event is queued.
# - applier_stop: Called after the SQL Thread is stopped
# - thread_stop: Called after the IO Thread is stopped.
#

--source include/have_replication_observers_example_plugin.inc
--source include/not_group_replication_plugin.inc
--source include/have_binlog_format_mixed.inc
--source include/master-slave.inc

--connection slave
--echo #
--echo # Stop slave and install plugin.
--echo #
--source include/stop_slave.inc
--source include/install_replication_observers_example.inc

--echo #
--echo # Cause a reset slave notification.
--echo #
RESET SLAVE;

--echo #
--echo # Cause a connect notification.
--echo #
--source include/start_slave.inc

--echo #
--echo # Execute some transactions on master to cause the other notifications.
--echo #
--connection master

CREATE TABLE t1 (c1 INT) Engine=InnoDB;
INSERT t1 VALUES(1);
DROP TABLE t1;
--source include/sync_slave_sql_with_master.inc

--echo #
--echo # Stop slave and uninstall plugin.
--echo #
--source include/stop_slave.inc
--source include/uninstall_replication_observers_example.inc

--echo #
--echo # Verify that all relay hooks were called.
--echo #
--let $grep_file=$MYSQLTEST_VARDIR/tmp/rpl_replication_observers_example_plugin_io.err
--let $grep_pattern=replication_observers_example_plugin:binlog_relay_after_reset_slave
--replace_regex /.* reported: \' //
--source include/grep_pattern.inc

--let $grep_file=$MYSQLTEST_VARDIR/tmp/rpl_replication_observers_example_plugin_io.err
--let $grep_pattern=replication_observers_example_plugin:binlog_relay_thread_start
--replace_regex /.* reported: \' //
--source include/grep_pattern.inc

--let $grep_file=$MYSQLTEST_VARDIR/tmp/rpl_replication_observers_example_plugin_io.err
--let $grep_pattern=replication_observers_example_plugin:binlog_relay_before_request_transmit
--replace_regex /.* reported: \' //
--source include/grep_pattern.inc

--let $grep_file=$MYSQLTEST_VARDIR/tmp/rpl_replication_observers_example_plugin_io.err
--let $grep_pattern=replication_observers_example_plugin:binlog_relay_after_read_event
--replace_regex /.* reported: \' //
--source include/grep_pattern.inc

--let $grep_file=$MYSQLTEST_VARDIR/tmp/rpl_replication_observers_example_plugin_io.err
--let $grep_pattern=replication_observers_example_plugin:binlog_relay_after_queue_event
--replace_regex /.* reported: \' //
--source include/grep_pattern.inc

--let $grep_file=$MYSQLTEST_VARDIR/tmp/rpl_replication_observers_example_plugin_io.err
--let $grep_pattern=replication_observers_example_plugin:binlog_relay_applier_start
--replace_regex /.* reported: \' //
--source include/grep_pattern.inc

--let $grep_file=$MYSQLTEST_VARDIR/tmp/rpl_replication_observers_example_plugin_io.err
--let $grep_pattern=replication_observers_example_plugin:binlog_relay_applier_stop
--replace_regex /.* reported: \' //
--source include/grep_pattern.inc

--let $grep_file=$MYSQLTEST_VARDIR/tmp/rpl_replication_observers_example_plugin_io.err
--let $grep_pattern=replication_observers_example_plugin:binlog_relay_thread_stop
--replace_regex /.* reported: \' //
--source include/grep_pattern.inc

--let $rpl_only_running_threads= 1
--source include/rpl_end.inc