Skip to content

Commit cf1bf08

Browse files
committed
WL#14190: Replace old terms in replication SQL commands on the SOURCE
This worklog implements aliases for RESET MASTER, SHOW MASTER STATUS and [CREATE|ALTER] EVENT ... DISABLE ON SLAVE. The aliases are RESET BINARY LOGS AND GTIDS, SHOW BINARY LOG STATUS and [CREATE|ALTER] EVENT ...DISABLE ON REPLICA respectively. The storage of event information is also changed to avoid offensive terminology. This last change will also affect the output of the commands SHOW CREATE EVENT, SHOW EVENTS and queries to the information_schema.events table. Old syntax is deprecated. This worklog also deprecates PURGE MASTER LOGS and SHOW MASTER LOGS in favor of existing syntax PURGE BINARY LOGS and SHOW BINARY LOGS. There is also a new status variable Com_show_binary_log_status that is an alias to the existent Com_show_master_status. In order to provide logical dumps that are compatible with lower versions or external tools that only support the old deprecated terminology we also introduce a new option for mysqldump named: `--output-as-version`. Change-Id: Ic6f902186314fcd13226a1a09849e1a2ee43c068
1 parent c87453b commit cf1bf08

File tree

1,182 files changed

+5573
-4165
lines changed

Some content is hidden

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

1,182 files changed

+5573
-4165
lines changed

client/client_priv.h

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ enum options_client {
185185
OPT_AUTHENTICATION_KERBEROS_CLIENT_MODE,
186186
OPT_TLS_SNI_SERVERNAME,
187187
OPT_INIT_COMMAND_ADD,
188+
OPT_OUTPUT_AS_VERSION,
188189
/* Add new option above this */
189190
OPT_MAX_CLIENT_OPTION
190191
};

client/mysqladmin.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ static int execute_commands(MYSQL *mysql, int argc, char **argv) {
751751
case ADMIN_REFRESH:
752752
if (mysql_refresh(mysql, (uint) ~(REFRESH_GRANT | REFRESH_STATUS |
753753
REFRESH_READ_LOCK | REFRESH_REPLICA |
754-
REFRESH_MASTER))) {
754+
REFRESH_SOURCE))) {
755755
my_printf_error(0, "refresh failed; error: '%s'", error_flags,
756756
mysql_error(mysql));
757757
return -1;

client/mysqldump.cc

+315-124
Large diffs are not rendered by default.

client/mysqltest.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -5026,8 +5026,8 @@ static void do_sync_with_master2(struct st_command *command, long offset) {
50265026

50275027
if (!result_str || result < 0) {
50285028
/* source_pos_wait returned NULL or < 0 */
5029-
show_query(mysql, "SHOW MASTER STATUS");
5030-
show_query(mysql, "SHOW SLAVE STATUS");
5029+
show_query(mysql, "SHOW BINARY LOG STATUS");
5030+
show_query(mysql, "SHOW REPLICA STATUS");
50315031
show_query(mysql, "SHOW PROCESSLIST");
50325032
fprintf(stderr, "analyze: sync_with_master\n");
50335033

@@ -5191,14 +5191,14 @@ static int do_save_master_pos() {
51915191
*/
51925192
ndb_wait_for_binlog_injector();
51935193

5194-
if (mysql_query_wrapper(mysql, query = "show master status"))
5195-
die("failed in 'show master status': %d %s", mysql_errno(mysql),
5194+
if (mysql_query_wrapper(mysql, query = "show binary log status"))
5195+
die("failed in 'SHOW BINARY LOG STATUS': %d %s", mysql_errno(mysql),
51965196
mysql_error(mysql));
51975197

51985198
if (!(res = mysql_store_result_wrapper(mysql)))
51995199
die("mysql_store_result() retuned NULL for '%s'", query);
52005200
if (!(row = mysql_fetch_row_wrapper(res)))
5201-
die("empty result in show master status");
5201+
die("empty result in SHOW BINARY LOG STATUS");
52025202
my_stpnmov(master_pos.file, row[0], sizeof(master_pos.file) - 1);
52035203
master_pos.pos = strtoul(row[1], (char **)nullptr, 10);
52045204
mysql_free_result_wrapper(res);

include/mysql_com.h

+10-5
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,21 @@
221221
#define REFRESH_STATUS 16 /**< Flush status variables, FLUSH STATUS */
222222
#define REFRESH_THREADS 32 /**< Flush thread cache */
223223
#define REFRESH_REPLICA \
224-
64 /**< Reset master info and restart replica \
224+
64 /**< Reset source info and restart replica \
225225
thread, RESET REPLICA */
226226
#define REFRESH_SLAVE \
227-
REFRESH_REPLICA /**< Reset master info and restart replica \
227+
REFRESH_REPLICA /**< Reset source info and restart replica \
228228
thread, RESET REPLICA. This is deprecated, \
229229
use REFRESH_REPLICA instead. */
230230

231-
#define REFRESH_MASTER \
232-
128 /**< Remove all bin logs in the index \
233-
and truncate the index, RESET MASTER */
231+
#define REFRESH_SOURCE \
232+
128 /**< Remove all bin logs in the index \
233+
and truncate the index. Also resets \
234+
GTID information. Command: \
235+
RESET BINARY LOGS AND GTIDS */
236+
#define REFRESH_MASTER \
237+
REFRESH_SOURCE /**< This is deprecated, use REFRESH_SOURCE instead. */
238+
234239
#define REFRESH_ERROR_LOG 256 /**< Rotate only the error log */
235240
#define REFRESH_ENGINE_LOG 512 /**< Flush all storage engine logs */
236241
#define REFRESH_BINARY_LOG 1024 /**< Flush the binary log */

mysql-test/extra/binlog_tests/binlog.test

+13-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
-- source include/have_log_bin.inc
66
-- source include/have_debug.inc
77

8-
RESET MASTER;
8+
RESET BINARY LOGS AND GTIDS;
99

1010
create table t1 (a int) engine=innodb;
1111
create table t2 (a int) engine=innodb;
@@ -32,7 +32,7 @@ SET @@session.binlog_transaction_compression = FALSE;
3232
--enable_result_log
3333
--enable_query_log
3434

35-
reset master;
35+
reset binary logs and gtids;
3636
let $1=100;
3737

3838
create table t1 (n int) engine=innodb;
@@ -47,7 +47,7 @@ while ($1)
4747
commit;
4848
drop table t1;
4949
--source include/show_binlog_events.inc
50-
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
50+
--let $binlog_file= query_get_value(SHOW BINARY LOG STATUS, File, 1)
5151
--source include/show_binlog_events.inc
5252
--let $binlog_file=
5353

@@ -77,7 +77,7 @@ set @ac = @@autocommit;
7777
# first show this to work for SHOW BINLOG EVENTS
7878

7979
set autocommit= 0;
80-
reset master;
80+
reset binary logs and gtids;
8181
create table t1(n int) engine=innodb;
8282
begin;
8383
insert into t1 values (1);
@@ -101,7 +101,7 @@ SET @@session.binlog_transaction_compression = FALSE;
101101

102102
set @bcs = @@binlog_cache_size;
103103
set global binlog_cache_size=4096;
104-
reset master;
104+
reset binary logs and gtids;
105105

106106
create table t1 (a int, b char(255)) engine=innodb;
107107

@@ -139,7 +139,7 @@ SET @@session.binlog_transaction_compression = @saved_btc;
139139
--disable_warnings
140140
drop table if exists t1;
141141
--enable_warnings
142-
reset master;
142+
reset binary logs and gtids;
143143
create table t1 (a bigint unsigned, b bigint(20) unsigned);
144144
prepare stmt from "insert into t1 values (?,?)";
145145
set @a= 9999999999999999;
@@ -154,7 +154,7 @@ drop table t1;
154154
# Bug #39182: Binary log producing incompatible character set query from
155155
# stored procedure.
156156
#
157-
reset master;
157+
reset binary logs and gtids;
158158
CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
159159
USE bug39182;
160160
CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
@@ -233,7 +233,7 @@ DROP PROCEDURE p4;
233233
# Test of a too big SET INSERT_ID: see if the truncated value goes
234234
# into binlog (right), or the too big value (wrong); we look at the
235235
# binlog further down with SHOW BINLOG EVENTS.
236-
reset master;
236+
reset binary logs and gtids;
237237
create table t1 (id tinyint auto_increment primary key);
238238
set insert_id=128;
239239
insert ignore into t1 values(null);
@@ -276,7 +276,7 @@ drop table t1,t2,t3,tt1;
276276

277277
#Bug #26079 max_binlog_size + innodb = not make new binlog and hang server
278278
# server should not hang, binlog must rotate in the end
279-
reset master;
279+
reset binary logs and gtids;
280280

281281
# temporarily disable compression for this test case, since it needs
282282
# to create a large binlog to rotate it.
@@ -290,21 +290,21 @@ SET @@session.binlog_transaction_compression = FALSE;
290290
drop table if exists t3;
291291
--enable_warnings
292292
create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
293-
--let $binlog_file1= query_get_value(SHOW MASTER STATUS, File, 1)
293+
--let $binlog_file1= query_get_value(SHOW BINARY LOG STATUS, File, 1)
294294
--echo File $binlog_file1
295295
let $it=4;
296296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}
301-
--let $binlog_file2= query_get_value(SHOW MASTER STATUS, File, 1)
301+
--let $binlog_file2= query_get_value(SHOW BINARY LOG STATUS, File, 1)
302302
--echo *** show new binlog index after rotating ***
303303
--echo File $binlog_file2
304304
drop table t3;
305305

306306
# clean up
307-
RESET MASTER;
307+
RESET BINARY LOGS AND GTIDS;
308308
--disable_result_log
309309
--disable_query_log
310310
SET @@session.binlog_transaction_compression = @saved_btc;
@@ -333,7 +333,7 @@ DROP TABLES t1, t2;
333333
connect (fresh,localhost,root,,test);
334334
connection fresh;
335335

336-
RESET MASTER;
336+
RESET BINARY LOGS AND GTIDS;
337337
CREATE TABLE t1 (a INT PRIMARY KEY);
338338

339339
# Format description event, with server_id = 10;

mysql-test/extra/binlog_tests/binlog_crash_safe_ddl.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ if ($do_only_regular_logging)
7979
if ($do_pre_binlog)
8080
{
8181
FLUSH LOGS;
82-
--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
82+
--let $binlog_file= query_get_value("SHOW BINARY LOG STATUS", File, 1)
8383

8484
#
8585
# prepare, the first CRASH, /* log, commit */
@@ -132,7 +132,7 @@ if ($do_pre_binlog)
132132
if ($do_post_binlog)
133133
{
134134
FLUSH LOGS;
135-
--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
135+
--let $binlog_file= query_get_value("SHOW BINARY LOG STATUS", File, 1)
136136

137137
#
138138
# prepare, log, the 2nd CRASH, /* commit */

mysql-test/extra/binlog_tests/binlog_implicit_commit.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ let $prepare = SET AUTOCOMMIT = 1;
4343
let $statement = SET AUTOCOMMIT = 0;
4444
source extra/binlog_tests/implicit.test;
4545

46-
RESET MASTER;
46+
RESET BINARY LOGS AND GTIDS;
4747
SET AUTOCOMMIT = 0;
4848
INSERT INTO t1 VALUES (1);
4949
source include/show_binlog_events.inc;

mysql-test/extra/binlog_tests/binlog_innodb.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
SET BINLOG_FORMAT=MIXED;
33

4-
RESET MASTER;
4+
RESET BINARY LOGS AND GTIDS;
55

66
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=INNODB;
77
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);

mysql-test/extra/binlog_tests/binlog_mysqlbinlog_fill.inc

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,32 @@
2222
--let $datetime_1= 2031-01-01 12:00:00
2323
eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_1");
2424
INSERT INTO t1 VALUES(1);
25-
--let $pos_1= query_get_value(SHOW MASTER STATUS, Position, 1)
25+
--let $pos_1= query_get_value(SHOW BINARY LOG STATUS, Position, 1)
2626

2727
# One transaction with timestamp 2032-01-01 12:00:00
2828
--let $datetime_2= 2032-01-01 12:00:00
2929
eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_2");
3030
INSERT INTO t1 VALUES(2);
31-
--let $pos_2= query_get_value(SHOW MASTER STATUS, Position, 1)
31+
--let $pos_2= query_get_value(SHOW BINARY LOG STATUS, Position, 1)
3232

3333
# One transaction with timestamp 2033-01-01 12:00:00
3434
eval SET TIMESTAMP= UNIX_TIMESTAMP("2033-01-01 12:00:00");
3535
INSERT INTO t1 VALUES(3);
3636

37-
--let $file_1= query_get_value(SHOW MASTER STATUS, File, 1)
37+
--let $file_1= query_get_value(SHOW BINARY LOG STATUS, File, 1)
3838
FLUSH LOGS;
3939

4040
#Binlog 2:
4141
# One transaction with timestamp 2034-01-01 12:00:00
4242
SET TIMESTAMP= UNIX_TIMESTAMP("2034-01-01 12:00:00");
4343
INSERT INTO t1 VALUES(4);
44-
--let $pos_3= query_get_value(SHOW MASTER STATUS, Position, 1)
44+
--let $pos_3= query_get_value(SHOW BINARY LOG STATUS, Position, 1)
4545

4646
# One transaction with timestamp 2035-01-01 12:00:00
4747
--let $datetime_3= 2035-01-01 12:00:00
4848
eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_3");
4949
INSERT INTO t1 VALUES(5);
5050

51-
--let $file_2= query_get_value(SHOW MASTER STATUS, File, 1)
51+
--let $file_2= query_get_value(SHOW BINARY LOG STATUS, File, 1)
5252
FLUSH LOGS;
5353

mysql-test/extra/binlog_tests/binlog_mysqlbinlog_row.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SET timestamp=1000000000;
1313
--echo #
1414
--echo # Delete all existing binary logs.
1515
--echo #
16-
RESET MASTER;
16+
RESET BINARY LOGS AND GTIDS;
1717

1818

1919
CREATE TABLE t1 (c01 BIT);

mysql-test/extra/binlog_tests/binlog_mysqlbinlog_start_stop.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# TODO: Need to look at making row based version once new binlog client is complete.
1010

1111
CREATE TABLE t1 (a INT);
12-
RESET MASTER;
12+
RESET BINARY LOGS AND GTIDS;
1313

1414
--source extra/binlog_tests/binlog_mysqlbinlog_fill.inc
1515

mysql-test/extra/binlog_tests/binlog_row_kill_create_select.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
--eval CREATE TABLE t1 (c1 INT) ENGINE = $engine
2222
INSERT INTO t1 VALUES (1);
2323
INSERT INTO t1 VALUES (2);
24-
RESET MASTER;
24+
RESET BINARY LOGS AND GTIDS;
2525

2626
# Test case1
2727
--connect(con1,localhost,root)

mysql-test/extra/binlog_tests/binlog_select_taking_write_locks.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ DROP TABLE t2;
125125
DROP TABLE t3;
126126
DROP TABLE t4;
127127

128-
RESET MASTER;
128+
RESET BINARY LOGS AND GTIDS;

0 commit comments

Comments
 (0)