| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# When mysqlbinlog connects to a running server it uses the client command |
| 4 |
# COM_BINLOG_DUMP, and this command has a flag called BINLOG_DUMP_NON_BLOCK |
| 5 |
# which instructs the server to stop sending when it reaches the end of the |
| 6 |
# binary log. |
| 7 |
# |
| 8 |
# |
| 9 |
# There are two ways provided by the server to set the non-blocking behavior. |
| 10 |
# 1) Setting the connection-server-id=0. (this is the default value of |
| 11 |
# connection-server-id) |
| 12 |
# 2) Setting BINLOG_DUMP_NON_BLOCK flag |
| 13 |
# --To test this, we set connection-server-id to some value other then zero |
| 14 |
# and not calling stop-never option in mysqlbinlog |
| 15 |
# |
| 16 |
# ==== Bug and Worklog references ==== |
| 17 |
# |
| 18 |
# BUG##18000079 - binlog_dump_non_block disappeared in mysql 5.6 |
| 19 |
# - Created the test to verify the bugfix. |
| 20 |
# |
| 21 |
# ==== Implementation ==== |
| 22 |
|
| 23 |
# connection-server-id is a debug option. That's why we need include/have_debug.inc |
| 24 |
--source include/have_debug.inc |
| 25 |
|
| 26 |
# As it is enough to test with one binlog format. |
| 27 |
--source include/have_binlog_format_statement.inc |
| 28 |
|
| 29 |
# |
| 30 |
# The test case records the output of mysqlbinlog, thence if compression |
| 31 |
# is enabled, then it fails as the compression event is output. |
| 32 |
# |
| 33 |
--source include/not_binlog_transaction_compression_on.inc |
| 34 |
|
| 35 |
CREATE TABLE t1 (a INT); |
| 36 |
RESET MASTER; |
| 37 |
|
| 38 |
--source extra/binlog_tests/binlog_mysqlbinlog_fill.inc |
| 39 |
|
| 40 |
# Verify Non blocking behaviour with connection-server-id=0 |
| 41 |
--echo |
| 42 |
--echo ==== Remote with to-last-log stop-never connection-server-id=0 ==== |
| 43 |
--let $extra_options= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT $file_1 |
| 44 |
--let $options= --to-last-log --stop-never --connection-server-id=0 |
| 45 |
--source extra/binlog_tests/mysqlbinlog_start_stop_2.inc |
| 46 |
|
| 47 |
# Verify Non blocking behaviour for BINLOG_DUMP_NON_BLOCK by setting |
| 48 |
# connection-server-id=1 and not setting --stop-never |
| 49 |
--echo |
| 50 |
--echo ==== Remote with connection-server-id= (value other than 0) ==== |
| 51 |
--let $extra_options= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT $file_1 |
| 52 |
--let $options= --to-last-log --connection-server-id=1 |
| 53 |
--source extra/binlog_tests/mysqlbinlog_start_stop_2.inc |
| 54 |
|
| 55 |
--echo |
| 56 |
--echo ==== clean up ==== |
| 57 |
DROP TABLE t1; |