File: mariadb-dump_slave.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (55 lines) | stat: -rw-r--r-- 2,047 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
# `mariadb-dump --dump-slave` multi-source interactions
# (see `main.rpl_mysqldump_slave` for general testing with single-source)

--source include/have_log_bin.inc
--let $status_items= Connection_name, Slave_IO_Running, Slave_SQL_Running
--let $all_slaves_status= 1

# $MYSQL_DUMP dumps the $SERVER_MYPORT_1 server
--connect (  active_master, 127.0.0.1, root, , , $SERVER_MYPORT_2)
--connect (inactive_master, 127.0.0.1, root, , , $SERVER_MYPORT_3)
--connect (          slave, 127.0.0.1, root, , , $SERVER_MYPORT_1)

--replace_result $SERVER_MYPORT_2 MYPORT_2
eval CHANGE MASTER TO
  master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root';
START SLAVE SQL_THREAD;
--replace_result $SERVER_MYPORT_3 MYPORT_3
eval CHANGE MASTER 'inactive' TO
  master_host='127.0.0.1', master_port=$SERVER_MYPORT_3;
# wait for the active default '' connection only
--source include/wait_for_slave_sql_to_start.inc


--echo # Control State
--source include/show_slave_status.inc

--echo # Basic
--echo \$MYSQL_DUMP --compact --dump-slave --include-master-host-port test
--replace_result $SERVER_MYPORT_2 MYPORT_2 $SERVER_MYPORT_3 MYPORT_3
--exec  $MYSQL_DUMP --compact --dump-slave --include-master-host-port test


# The 'inactive' connection should remain stopped
# while the active '' connection should restart.

--echo # MDEV-7611 mysqldump --dump-slave always starts stopped slave
--echo \$MYSQL_DUMP --compact --dump-slave test
--exec  $MYSQL_DUMP --compact --dump-slave test
--source include/wait_for_slave_sql_to_start.inc
--source include/show_slave_status.inc

--echo # MDEV-5624 mysqldump --dump-slave option does not restart the replication if the dump has failed
--echo \$MYSQL_DUMP --compact --dump-slave no_such_db
--error 2
--exec  $MYSQL_DUMP --compact --dump-slave no_such_db
--source include/wait_for_slave_sql_to_start.inc
--source include/show_slave_status.inc


--echo # Cleanup
STOP SLAVE SQL_THREAD;
--disconnect active_master
--disconnect inactive_master
--source include/wait_for_slave_sql_to_stop.inc
--disconnect slave