3 # Check that two or more servers have identical databases; fail if not.
7 # --let $diff_servers= 1 2
8 # [--let $databases= db1 db2 ...]
9 # [--let $rpl_debug= 1]
10 # --source include/diff_servers.inc
13 --let $_ds_info= servers=$diff_servers
16 --let $_ds_info= $_ds_info databases=$databases
18 --let $include_filename= diff_servers.inc [$_ds_info]
19 --source include/begin_include_file.inc
22 --let $_ds_databases= $diff_database
23 if ($_ds_databases ==
'')
25 --let $_ds_databases= `SELECT GROUP_CONCAT(SCHEMA_NAME SEPARATOR
' ') FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN (
'information_schema',
'mtr',
'mysql',
'performance_schema')`
28 # generate command line
29 --let $_ds_arg= --defaults-
group-suffix=.
30 --let $_ds_number_pos= `SELECT LOCATE(
'$_ds_arg',
'$MYSQL_DUMP') + LENGTH(
'$_ds_arg')`
31 --let $_ds_pre_command= `SELECT SUBSTR(
'$MYSQL_DUMP', 1, $_ds_number_pos - 1)`
32 --let $_ds_post_command= `SELECT SUBSTR(
'$MYSQL_DUMP', $_ds_number_pos + 1)`
33 --let $_ds_post_command= $_ds_post_command --compact --order-by-primary --
skip-extended-insert --no-create-info --databases $_ds_databases
34 --let $_ds_prev_outfile=
36 # iterate over servers
37 --let $_ds_servers= $diff_servers
38 while ($_ds_servers !=
'')
40 --let $_ds_server_number= `SELECT SUBSTRING_INDEX(
'$_ds_servers',
' ', 1)`
41 --let $_ds_servers= `SELECT TRIM(SUBSTRING(
'$_ds_servers', 1 + LENGTH(
'_$ds_server_number')))`
42 --let $_ds_outfile= $MYSQLTEST_VARDIR/tmp/diff_servers_$_ds_server_number
46 --echo generating dump from server
'$_ds_server_number' using command
'$_ds_pre_command$_ds_server_number $_ds_post_command > $_ds_outfile'
47 --echo remaining servers:
'$_ds_servers'
49 --exec $_ds_pre_command$_ds_server_number $_ds_post_command > $_ds_outfile
51 if ($_ds_prev_outfile !=
'')
55 --echo diffing files
'$_ds_prev_outfile' and
'$_ds_outfile'
57 --diff_files $_ds_prev_outfile $_ds_outfile
59 --remove_file $_ds_prev_outfile
61 --let $_ds_prev_outfile= $_ds_outfile
64 --remove_file $_ds_prev_outfile
66 --let $include_filename= diff_servers.inc [servers=$_ds_info]
67 --source include/end_include_file.inc