@@ -147,8 +147,8 @@ static bool ansi_quotes_mode = false;
147
147
static uint opt_zstd_compress_level = default_zstd_compression_level;
148
148
static char *opt_compress_algorithm = nullptr ;
149
149
150
- #define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1
151
- #define MYSQL_OPT_MASTER_DATA_COMMENTED_SQL 2
150
+ #define MYSQL_OPT_SOURCE_DATA_EFFECTIVE_SQL 1
151
+ #define MYSQL_OPT_SOURCE_DATA_COMMENTED_SQL 2
152
152
#define MYSQL_OPT_SLAVE_DATA_EFFECTIVE_SQL 1
153
153
#define MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL 2
154
154
static uint opt_enable_cleartext_plugin = 0 ;
@@ -240,11 +240,16 @@ static struct my_option my_long_options[] = {
240
240
{" allow-keywords" , OPT_KEYWORDS,
241
241
" Allow creation of column names that are keywords." , &opt_keywords,
242
242
&opt_keywords, nullptr , GET_BOOL, NO_ARG, 0 , 0 , 0 , nullptr , 0 , nullptr },
243
- {" apply-replica-statements" , OPT_MYSQLDUMP_SLAVE_APPLY ,
243
+ {" apply-replica-statements" , OPT_MYSQLDUMP_REPLICA_APPLY ,
244
244
" Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom "
245
245
" of dump." ,
246
246
&opt_slave_apply, &opt_slave_apply, nullptr , GET_BOOL, NO_ARG, 0 , 0 , 0 ,
247
247
nullptr , 0 , nullptr },
248
+ {" apply-slave-statements" , OPT_MYSQLDUMP_SLAVE_APPLY_DEPRECATED,
249
+ " This option is deprecated and will be removed in a future version. "
250
+ " Use apply-replica-statements instead." ,
251
+ &opt_slave_apply, &opt_slave_apply, nullptr , GET_BOOL, NO_ARG, 0 , 0 , 0 ,
252
+ nullptr , 0 , nullptr },
248
253
{" bind-address" , 0 , " IP address to bind to." , (uchar **)&opt_bind_addr,
249
254
(uchar **)&opt_bind_addr, nullptr , GET_STR, REQUIRED_ARG, 0 , 0 , 0 , nullptr ,
250
255
0 , nullptr },
@@ -311,18 +316,23 @@ static struct my_option my_long_options[] = {
311
316
{" default-character-set" , OPT_DEFAULT_CHARSET,
312
317
" Set the default character set." , &default_charset, &default_charset,
313
318
nullptr , GET_STR, REQUIRED_ARG, 0 , 0 , 0 , nullptr , 0 , nullptr },
314
- {" delete-source-logs" , OPT_DELETE_MASTER_LOGS ,
319
+ {" delete-source-logs" , OPT_DELETE_SOURCE_LOGS ,
315
320
" Rotate logs before the backup, equivalent to FLUSH LOGS, and purge "
316
321
" all old binary logs after the backup, equivalent to PURGE LOGS. This "
317
322
" automatically enables --source-data." ,
318
323
&opt_delete_master_logs, &opt_delete_master_logs, nullptr , GET_BOOL,
319
324
NO_ARG, 0 , 0 , 0 , nullptr , 0 , nullptr },
325
+ {" delete-master-logs" , OPT_DELETE_MASTER_LOGS_DEPRECATED,
326
+ " This option is deprecated and will be removed in a future version. "
327
+ " Use delete-source-logs instead." ,
328
+ &opt_delete_master_logs, &opt_delete_master_logs, nullptr , GET_BOOL,
329
+ NO_ARG, 0 , 0 , 0 , nullptr , 0 , nullptr },
320
330
{" disable-keys" , ' K' ,
321
331
" '/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER "
322
332
" TABLE tb_name ENABLE KEYS */; will be put in the output." ,
323
333
&opt_disable_keys, &opt_disable_keys, nullptr , GET_BOOL, NO_ARG, 1 , 0 , 0 ,
324
334
nullptr , 0 , nullptr },
325
- {" dump-replica" , OPT_MYSQLDUMP_SLAVE_DATA ,
335
+ {" dump-replica" , OPT_MYSQLDUMP_REPLICA_DATA ,
326
336
" This causes the binary log position and filename of the source to be "
327
337
" appended to the dumped data output. Setting the value to 1, will print"
328
338
" it as a CHANGE MASTER command in the dumped data output; if equal"
@@ -335,6 +345,11 @@ static struct my_option my_long_options[] = {
335
345
" Option automatically turns --lock-tables off." ,
336
346
&opt_slave_data, &opt_slave_data, nullptr , GET_UINT, OPT_ARG, 0 , 0 ,
337
347
MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL, nullptr , 0 , nullptr },
348
+ {" dump-slave" , OPT_MYSQLDUMP_SLAVE_DATA_DEPRECATED,
349
+ " This option is deprecated and will be removed in a future version. "
350
+ " Use dump-replica instead." ,
351
+ &opt_slave_data, &opt_slave_data, nullptr , GET_UINT, OPT_ARG, 0 , 0 ,
352
+ MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL, nullptr , 0 , nullptr },
338
353
{" events" , ' E' , " Dump events." , &opt_events, &opt_events, nullptr , GET_BOOL,
339
354
NO_ARG, 0 , 0 , 0 , nullptr , 0 , nullptr },
340
355
{" extended-insert" , ' e' ,
@@ -400,11 +415,17 @@ static struct my_option my_long_options[] = {
400
415
" --ignore-table=database.table." ,
401
416
nullptr , nullptr , nullptr , GET_STR, REQUIRED_ARG, 0 , 0 , 0 , nullptr , 0 ,
402
417
nullptr },
403
- {" include-source-host-port" , OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT ,
418
+ {" include-source-host-port" , OPT_MYSQLDUMP_INCLUDE_SOURCE_HOST_PORT ,
404
419
" Adds 'MASTER_HOST=<host>, MASTER_PORT=<port>' to 'CHANGE MASTER TO..' "
405
420
" in dump produced with --dump-replica." ,
406
421
&opt_include_master_host_port, &opt_include_master_host_port, nullptr ,
407
422
GET_BOOL, NO_ARG, 0 , 0 , 0 , nullptr , 0 , nullptr },
423
+ {" include-master-host-port" ,
424
+ OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT_DEPRECATED,
425
+ " This option is deprecated and will be removed in a future version. "
426
+ " Use include-source-host-port instead." ,
427
+ &opt_include_master_host_port, &opt_include_master_host_port, nullptr ,
428
+ GET_BOOL, NO_ARG, 0 , 0 , 0 , nullptr , 0 , nullptr },
408
429
{" insert-ignore" , OPT_INSERT_IGNORE, " Insert rows with INSERT IGNORE." ,
409
430
&opt_ignore, &opt_ignore, nullptr , GET_BOOL, NO_ARG, 0 , 0 , 0 , nullptr , 0 ,
410
431
nullptr },
@@ -424,7 +445,7 @@ static struct my_option my_long_options[] = {
424
445
" Append warnings and errors to given file." , &log_error_file,
425
446
&log_error_file, nullptr , GET_STR, REQUIRED_ARG, 0 , 0 , 0 , nullptr , 0 ,
426
447
nullptr },
427
- {" source-data" , OPT_MASTER_DATA ,
448
+ {" source-data" , OPT_SOURCE_DATA ,
428
449
" This causes the binary log position and filename to be appended to the "
429
450
" output. If equal to 1, will print it as a CHANGE MASTER command; if equal"
430
451
" to 2, that command will be prefixed with a comment symbol. "
@@ -436,7 +457,12 @@ static struct my_option my_long_options[] = {
436
457
" any action on logs will happen at the exact moment of the dump. "
437
458
" Option automatically turns --lock-tables off." ,
438
459
&opt_master_data, &opt_master_data, nullptr , GET_UINT, OPT_ARG, 0 , 0 ,
439
- MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, nullptr , 0 , nullptr },
460
+ MYSQL_OPT_SOURCE_DATA_COMMENTED_SQL, nullptr , 0 , nullptr },
461
+ {" master-data" , OPT_MASTER_DATA_DEPRECATED,
462
+ " This option is deprecated and will be removed in a future version. "
463
+ " Use source-data instead." ,
464
+ &opt_master_data, &opt_master_data, nullptr , GET_UINT, OPT_ARG, 0 , 0 ,
465
+ MYSQL_OPT_SOURCE_DATA_COMMENTED_SQL, nullptr , 0 , nullptr },
440
466
{" max_allowed_packet" , OPT_MAX_ALLOWED_PACKET,
441
467
" The maximum packet length to send to or receive from server." ,
442
468
&opt_max_allowed_packet, &opt_max_allowed_packet, nullptr , GET_ULONG,
@@ -890,14 +916,31 @@ static bool get_one_option(int optid, const struct my_option *opt,
890
916
case ' ?' :
891
917
usage ();
892
918
exit (0 );
893
- case (int )OPT_MASTER_DATA:
919
+ case (int )OPT_MASTER_DATA_DEPRECATED:
920
+ CLIENT_WARN_DEPRECATED (" --master-data" , " --source-data" );
921
+ // FALLTHROUGH
922
+ case (int )OPT_SOURCE_DATA:
894
923
if (!argument) /* work like in old versions */
895
- opt_master_data = MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL ;
924
+ opt_master_data = MYSQL_OPT_SOURCE_DATA_EFFECTIVE_SQL ;
896
925
break ;
897
- case (int )OPT_MYSQLDUMP_SLAVE_DATA:
926
+ case (int )OPT_MYSQLDUMP_SLAVE_APPLY_DEPRECATED:
927
+ CLIENT_WARN_DEPRECATED (" --apply-slave-statements" ,
928
+ " --apply-replica-statements" );
929
+ break ;
930
+ case (int )OPT_DELETE_MASTER_LOGS_DEPRECATED:
931
+ CLIENT_WARN_DEPRECATED (" --delete-master-logs" , " --delete-source-logs" );
932
+ break ;
933
+ case (int )OPT_MYSQLDUMP_SLAVE_DATA_DEPRECATED:
934
+ CLIENT_WARN_DEPRECATED (" --dump-slave" , " --dump-replica" );
935
+ // FALLTHROUGH
936
+ case (int )OPT_MYSQLDUMP_REPLICA_DATA:
898
937
if (!argument) /* work like in old versions */
899
938
opt_slave_data = MYSQL_OPT_SLAVE_DATA_EFFECTIVE_SQL;
900
939
break ;
940
+ case (int )OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT_DEPRECATED:
941
+ CLIENT_WARN_DEPRECATED (" --include-master-host-port" ,
942
+ " --include-source-host-port" );
943
+ break ;
901
944
case (int )OPT_OPTIMIZE:
902
945
extended_insert = opt_drop = opt_lock = quick = create_options =
903
946
opt_disable_keys = lock_tables = opt_set_charset = true ;
@@ -1018,7 +1061,7 @@ static int get_options(int *argc, char ***argv) {
1018
1061
1019
1062
/* Ensure consistency of the set of binlog & locking options */
1020
1063
if (opt_delete_master_logs && !opt_master_data)
1021
- opt_master_data = MYSQL_OPT_MASTER_DATA_COMMENTED_SQL ;
1064
+ opt_master_data = MYSQL_OPT_SOURCE_DATA_COMMENTED_SQL ;
1022
1065
if (opt_single_transaction && opt_lock_all_tables) {
1023
1066
fprintf (stderr,
1024
1067
" %s: You can't use --single-transaction and "
@@ -4935,7 +4978,7 @@ static int do_show_master_status(MYSQL *mysql_con) {
4935
4978
MYSQL_ROW row;
4936
4979
MYSQL_RES *master;
4937
4980
const char *comment_prefix =
4938
- (opt_master_data == MYSQL_OPT_MASTER_DATA_COMMENTED_SQL ) ? " -- " : " " ;
4981
+ (opt_master_data == MYSQL_OPT_SOURCE_DATA_COMMENTED_SQL ) ? " -- " : " " ;
4939
4982
if (mysql_query_with_error_report (mysql_con, &master, " SHOW MASTER STATUS" )) {
4940
4983
return 1 ;
4941
4984
} else {
0 commit comments