Skip to content

Commit e07e85c

Browse files
author
Sven Sandberg
committed
BUG#36181365: Fix terminology in replication test utilities
This changes terminology in filenames of replication test utilities: - Change terminology by applying the following replacements in all filenames for test utilities that need it, and in places their names occur in test files: master->source slave->replica slave_io->receiver slave_sql->applier mts->mta spco->rpco - Structure the test directories as follows: mysql-test/include Generic, reusable test utilities. Like today. mysql-test/include/rpl Moved all replication-related, reusable test utilities here, and removed the rpl_ prefix from the filename, for those that had it. Previously these were in mysql-test/include. mysql-test/include/rpl/impl Helper files used by files in mysql-test/rpl, which are internal to them and not usable by test cases. mysql-test/include/rpl/debug Replication-related, reusable debugging tools. These are only for temporary use in debugging sessions, and we should never push tests that use them. mysql-test/include/rpl/deprecated Old tools that have better alternatives nowadays. Don't use them. We only don't remove them because they are used by tests (and those tests work OK so no need to refactor them either). mysql-test/common Fragments of test cases that are shared between multiple tests, but not generally reusable. Typically, if a .inc file executes specific SQL statements, it probably belongs here rather than in mysql-test/include. This has two subdirectories: mysql-test/common/binlog Test fragments that use one server. Previously these were in mysql-test/extra/binlog_tests. (And some were erroneously in mysql-test/include or mysql-test/suite/binlog/include.) mysql-test/common/rpl Test fragments that use multiple servers. Previously these were in mysql-test/extra/rpl_tests. (And some were erroneously in mysql-test/include or mysql-test/suite/rpl/include.) - Rename include/only_* to include/have_* This makes the files follow existing convention. - For the files to init/deinit replication: include/master-slave.inc->include/rpl/init_source_replica.inc include/rpl_end.inc->include/rpl/deinit.inc - For the files used to sync nodes: sync_slave_sql_with_master.inc->sync_to_replica.inc sync_slave_io_with_master.inc->sync_to_replica_received.inc sync_slave_io.inc->sync_received_with_saved.inc sync_slave_sql.inc->sync_with_saved.inc sync_slave_sql_with_io.inc->sync_with_recieved.inc save_master_pos.inc->save_server_position.inc save_io_thread_pos.inc->save_received_position.inc rpl_get_end_of_relay_log.inc->save_relay_log_file_position.inc save_binlog_position.inc->save_binlog_file_position.inc - Clarify these names: get_relay_log_pos.inc->convert_binlog_position_to_relay_log_position.inc purge_first_log.inc->purge_first_binlog.inc wait_for_slave_param.inc->wait_for_replica_status.inc - Rename these assertion utilities: include/check_slave_is_running.inc->include/rpl/assert_replica_running.inc include/check_slave_no_error.inc->include/rpl/assert_replica_no_error.inc include/check_slave_param.inc->include/rpl/assert_replica_status.inc - Add mysql-test/include/readme.md. - Other minor changes. Change-Id: Ice3e43d0673e4654b820165da1f997c9ec78f66e
1 parent 837387f commit e07e85c

File tree

5,075 files changed

+72391
-71644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,075 files changed

+72391
-71644
lines changed

mysql-test/extra/binlog_tests/binlog.test renamed to mysql-test/common/binlog/binlog.test

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ begin;
1616
insert t2 values (5);
1717
commit;
1818
# first COMMIT must be Query_log_event, second - Xid_log_event
19-
source include/show_binlog_events.inc;
19+
source include/rpl/deprecated/show_binlog_events.inc;
2020
drop table t1,t2;
2121

2222
#
@@ -46,9 +46,9 @@ while ($1)
4646
--enable_query_log
4747
commit;
4848
drop table t1;
49-
--source include/show_binlog_events.inc
49+
--source include/rpl/deprecated/show_binlog_events.inc
5050
--let $binlog_file= query_get_value(SHOW BINARY LOG STATUS, File, 1)
51-
--source include/show_binlog_events.inc
51+
--source include/rpl/deprecated/show_binlog_events.inc
5252
--let $binlog_file=
5353

5454
--disable_result_log
@@ -85,7 +85,7 @@ insert into t1 values (2);
8585
insert into t1 values (3);
8686
commit;
8787
drop table t1;
88-
--source include/show_binlog_events.inc
88+
--source include/rpl/deprecated/show_binlog_events.inc
8989

9090
# now show that nothing breaks if we need to read from the cache more
9191
# than once, resulting in split event-headers
@@ -121,7 +121,7 @@ commit;
121121
show status like "binlog_cache_use";
122122
enable_query_log;
123123

124-
--source include/show_binlog_events.inc
124+
--source include/rpl/deprecated/show_binlog_events.inc
125125

126126
drop table t1;
127127

@@ -147,7 +147,7 @@ set @b= 14632475938453979136;
147147
execute stmt using @a, @b;
148148
deallocate prepare stmt;
149149
drop table t1;
150-
--source include/show_binlog_events.inc
150+
--source include/rpl/deprecated/show_binlog_events.inc
151151

152152

153153
#
@@ -181,7 +181,7 @@ END//
181181
DELIMITER ;//
182182

183183
CALL p1();
184-
source include/show_binlog_events.inc;
184+
source include/rpl/deprecated/show_binlog_events.inc;
185185

186186
DROP PROCEDURE p1;
187187
DROP TABLE t1;
@@ -268,7 +268,7 @@ use test;
268268
# subsequent statements in row format.
269269
connect (other,localhost,root,,test);
270270
connection other;
271-
source include/show_binlog_events.inc;
271+
source include/rpl/deprecated/show_binlog_events.inc;
272272
connection default;
273273
disconnect other;
274274

@@ -356,7 +356,7 @@ iOtVZR4UAAAAKAAAAPIEAAAAAG8AAAAAAAEAAgAB/wACAAAAB2NFFg==
356356

357357
# Show binlog events to check that server ids are correct.
358358
--let $show_binlog_events_mask_columns= 1,2,5
359-
--source include/show_binlog_events.inc
359+
--source include/rpl/deprecated/show_binlog_events.inc
360360

361361
DROP TABLE t1;
362362

mysql-test/extra/binlog_tests/binlog_row_kill_create_select.test renamed to mysql-test/common/binlog/binlog_row_kill_create_select.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# ==== Usage ====
88
#
99
# [--let $engine= MyISAM | --let $engine= InnoDB]
10-
# --source extra/binlog_tests/binlog_row_kill_create_select.test
10+
# --source common/binlog/binlog_row_kill_create_select.test
1111
#
1212
# ==== References ====
1313
#
@@ -56,6 +56,6 @@ RESET BINARY LOGS AND GTIDS;
5656
--connection default
5757
--echo # Verify that 'CREATE TABLE t2', 'CREATE TABLE t3' and
5858
--echo # 'CREATE TABLE t4' events were not logged.
59-
--source include/show_binlog_events.inc
59+
--source include/rpl/deprecated/show_binlog_events.inc
6060

6161
DROP TABLE t1;

mysql-test/extra/binlog_tests/binlog_truncate.test renamed to mysql-test/common/binlog/binlog_truncate.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if ($before_truncate) {
2222
eval $before_truncate;
2323
}
2424
TRUNCATE TABLE t2;
25-
source include/show_binlog_events.inc;
25+
source include/rpl/deprecated/show_binlog_events.inc;
2626

2727
DROP TABLE t1,t2;
2828

@@ -63,6 +63,6 @@ SELECT COUNT(*) FROM t2;
6363
connection default;
6464
--echo # Connection: default
6565

66-
source include/show_binlog_events.inc;
66+
source include/rpl/deprecated/show_binlog_events.inc;
6767
disconnect truncate;
6868
DROP TABLE t1,t2;

mysql-test/extra/binlog_tests/binlog_xa_prepared.test renamed to mysql-test/common/binlog/binlog_xa_prepared.test

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# has completed a necessary part of its cleanup.
1616
# Selecting from P_S.threads provides a method to learn that.
1717
#
18-
--source include/gtid_utils.inc
18+
--source include/rpl/gtid_utils.inc
1919

2020
# Total number of connection each performing one insert into table
2121
--let $conn_number=20
@@ -68,10 +68,10 @@ CREATE TABLE t (a INT) ENGINE=innodb;
6868
# reflect number of loops done in correctness computation.
6969
--let $restart_number = 0
7070
--let $how_to_restart=restart_mysqld.inc
71-
--source extra/binlog_tests/binlog_xa_prepared_do_and_restart.inc
71+
--source common/binlog/xa_prepared_do_and_restart.inc
7272

7373
--let $how_to_restart=kill_and_restart_mysqld.inc
74-
--source extra/binlog_tests/binlog_xa_prepared_do_and_restart.inc
74+
--source common/binlog/xa_prepared_do_and_restart.inc
7575

7676
--connection default
7777

@@ -97,7 +97,7 @@ DROP VIEW v_processlist;
9797
if (`SELECT @@global.log_bin`)
9898
{
9999
# Recording proper samples of binlogged prepared XA:s
100-
--source include/show_binlog_events.inc
100+
--source include/rpl/deprecated/show_binlog_events.inc
101101
}
102102

103103
# Multiplier 2 captures the XA two phase binlogging property
@@ -184,4 +184,4 @@ XA COMMIT 'xa1';
184184

185185
DROP TABLE t;
186186

187-
--source include/gtid_utils_end.inc
187+
--source include/rpl/gtid_utils_end.inc

mysql-test/extra/binlog_tests/blackhole.test renamed to mysql-test/common/binlog/blackhole.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ select * from t1;
128128
select * from t2;
129129
select * from t3;
130130

131-
--source include/show_binlog_events.inc
131+
--source include/rpl/deprecated/show_binlog_events.inc
132132

133133
drop table t1,t2,t3;
134134

@@ -191,7 +191,7 @@ set insert_id= 3;
191191
insert into t1 values (NULL), (33), (NULL);
192192
set insert_id= 5;
193193
insert into t1 values (55), (NULL);
194-
source include/show_binlog_events.inc;
194+
source include/rpl/deprecated/show_binlog_events.inc;
195195

196196
# cleanup
197197
drop table t1;

mysql-test/extra/binlog_tests/binlog_crash_safe_ddl.inc renamed to mysql-test/common/binlog/crash_safe_ddl.inc

+7-7
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ if ($do_only_regular_logging)
7474
}
7575
}
7676

77-
--source include/gtid_step_reset.inc
77+
--source include/rpl/gtid_step_reset.inc
7878

7979
if ($do_pre_binlog)
8080
{
@@ -118,14 +118,14 @@ if ($do_pre_binlog)
118118
{
119119
--let $keep_ddl_xid=1
120120
--let $show_binlog_events_mask_columns=1,2,4,5
121-
--source include/show_binlog_events.inc
121+
--source include/rpl/deprecated/show_binlog_events.inc
122122
}
123123

124124
# The Gtid check, when its mode ON.
125125
# After rollback-recovery of this branch Gtid executed must
126126
# remain as was before the query execution.
127127
--let $gtid_step_count=0
128-
--source include/gtid_step_assert.inc
128+
--source include/rpl/gtid_step_assert.inc
129129

130130
} # end of $do_pre_binlog
131131

@@ -171,15 +171,15 @@ if ($do_post_binlog)
171171
{
172172
--let $keep_ddl_xid=1
173173
--let $show_binlog_events_mask_columns=1,2,4,5
174-
--source include/show_binlog_events.inc
174+
--source include/rpl/deprecated/show_binlog_events.inc
175175
}
176176

177177
# The Gtid check, when its mode ON.
178178
# After commit-recovery of this branch Gtid executed must
179179
# receive a new gtid item of the current DDL transaction.
180180

181181
--let $gtid_step_count=1
182-
--source include/gtid_step_assert.inc
182+
--source include/rpl/gtid_step_assert.inc
183183

184184
} # end of $do_post_binlog
185185

@@ -193,15 +193,15 @@ if ($do_only_regular_logging)
193193
{
194194
--let $keep_ddl_xid=1
195195
--let $show_binlog_events_mask_columns=1,2,4,5
196-
--source include/show_binlog_events.inc
196+
--source include/rpl/deprecated/show_binlog_events.inc
197197
}
198198

199199
# The Gtid check, when its mode ON.
200200
# After commit-recovery of this branch Gtid executed must
201201
# receive a new gtid item of the current DDL transaction.
202202

203203
--let $gtid_step_count=1
204-
--source include/gtid_step_assert.inc
204+
--source include/rpl/gtid_step_assert.inc
205205
}
206206

207207
#

mysql-test/extra/binlog_tests/ctype_cp932_binlog.test renamed to mysql-test/common/binlog/ctype_cp932_binlog.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ SET @var1= x'8300';
2525
# code (and I have used it to test the fix) until there is some way to
2626
# exercise this code from mysql-test-run.
2727
EXECUTE stmt1 USING @var1;
28-
source include/show_binlog_events.inc;
28+
source include/rpl/deprecated/show_binlog_events.inc;
2929
SELECT HEX(f1) FROM t1;
3030
DROP table t1;
3131
# end test for bug#11338

mysql-test/extra/binlog_tests/ctype_ucs_binlog.test renamed to mysql-test/common/binlog/ctype_ucs_binlog.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ create table t2 (c char(30)) charset=ucs2;
88
set @v=convert('abc' using ucs2);
99
reset binary logs and gtids;
1010
insert into t2 values (@v);
11-
source include/show_binlog_events.inc;
11+
source include/rpl/deprecated/show_binlog_events.inc;
1212
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
1313
# absolutely need variables names to be quoted and strings to be
1414
# escaped).
1515
flush logs;
1616
let $MYSQLD_DATADIR= `select @@datadir`;
1717
--let $mysqlbinlog_parameters= --short-form $MYSQLD_DATADIR/binlog.000001
18-
--source include/mysqlbinlog.inc
18+
--source include/rpl/mysqlbinlog.inc
1919
drop table t2;
2020

2121
# End of 4.1 tests

mysql-test/extra/binlog_tests/database.test renamed to mysql-test/common/binlog/database.test

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ create trigger tr1 before insert on t1 for each row insert into t2 values (2*new
1313
create procedure sp1 (a int) insert into t1 values(a);
1414
drop database testing_1;
1515
--let $mask_binlog_commit_events= 1
16-
source include/show_binlog_events.inc;
16+
source include/rpl/deprecated/show_binlog_events.inc;
1717
--let $mask_binlog_commit_events= 0
1818

1919
# BUG#38773: DROP DATABASE cause switch to stmt-mode when there are
@@ -30,7 +30,7 @@ enable_warnings;
3030
insert into t1 values (1);
3131
drop table tt1, t1;
3232
--let $mask_binlog_commit_events= 1
33-
source include/show_binlog_events.inc;
33+
source include/rpl/deprecated/show_binlog_events.inc;
3434
--let $mask_binlog_commit_events= 0
3535

3636
FLUSH STATUS;
@@ -58,7 +58,7 @@ SET SESSION DEBUG='-d,rm_table_no_locks_abort_after_atomic_tables';
5858
# Both t1 and t2 remain as the whole statement is rolled back.
5959
SHOW TABLES FROM db1;
6060
--let $mask_binlog_commit_events= 1
61-
--source include/show_binlog_events.inc # Check that the binlog is empty.
61+
--source include/rpl/deprecated/show_binlog_events.inc # Check that the binlog is empty.
6262
--let $mask_binlog_commit_events= 0
6363

6464
# Cleanup

mysql-test/extra/binlog_tests/database_myisam.test renamed to mysql-test/common/binlog/database_myisam.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ SET SESSION DEBUG='+d,rm_table_no_locks_abort_after_atomic_tables';
2626
DROP DATABASE testing_1;
2727
SET SESSION DEBUG='-d,rm_table_no_locks_abort_after_atomic_tables';
2828
let $wait_binlog_event= DROP TABLE IF EXIST;
29-
source include/wait_for_binlog_event.inc;
29+
source include/rpl/wait_for_binlog_event.inc;
3030
let $MYSQLD_DATADIR= `SELECT @@datadir`;
3131

3232
--let $mask_binlog_commit_events= 1
33-
source include/show_binlog_events.inc;
33+
source include/rpl/deprecated/show_binlog_events.inc;
3434
--let $mask_binlog_commit_events= 0
3535

3636
--echo # Cleanup.

0 commit comments

Comments
 (0)