Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
74feebcd
Commit
74feebcd
authored
Feb 21, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-5624 mysqldump --dump-slave option does not restart the replication if the dump has failed
parent
ea0915dc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
7 deletions
+28
-7
client/mysqldump.c
client/mysqldump.c
+12
-7
mysql-test/r/rpl_mysqldump_slave.result
mysql-test/r/rpl_mysqldump_slave.result
+7
-0
mysql-test/t/rpl_mysqldump_slave.test
mysql-test/t/rpl_mysqldump_slave.test
+9
-0
No files found.
client/mysqldump.c
View file @
74feebcd
...
...
@@ -160,6 +160,8 @@ static void dynstr_set_checked(DYNAMIC_STRING *str, const char *init_str);
static
void
dynstr_append_mem_checked
(
DYNAMIC_STRING
*
str
,
const
char
*
append
,
uint
length
);
static
void
dynstr_realloc_checked
(
DYNAMIC_STRING
*
str
,
ulong
additional_size
);
static
int
do_start_slave_sql
(
MYSQL
*
mysql_con
);
/*
Constant for detection of default value of default_charset.
If default_charset is equal to mysql_universal_client_charset, then
...
...
@@ -1494,6 +1496,8 @@ static void free_resources()
static
void
maybe_exit
(
int
error
)
{
if
(
opt_slave_data
)
do_start_slave_sql
(
mysql
);
if
(
!
first_error
)
first_error
=
error
;
if
(
ignore_errors
)
...
...
@@ -5646,10 +5650,6 @@ int main(int argc, char **argv)
dump_databases
(
argv
);
}
/* if --dump-slave , start the slave sql thread */
if
(
opt_slave_data
&&
do_start_slave_sql
(
mysql
))
goto
err
;
/* add 'START SLAVE' to end of dump */
if
(
opt_slave_apply
&&
add_slave_statements
())
goto
err
;
...
...
@@ -5665,9 +5665,6 @@ int main(int argc, char **argv)
if
(
opt_delete_master_logs
&&
purge_bin_logs_to
(
mysql
,
bin_log_name
))
goto
err
;
#ifdef HAVE_SMEM
my_free
(
shared_memory_base_name
);
#endif
/*
No reason to explicitely COMMIT the transaction, neither to explicitely
UNLOCK TABLES: these will be automatically be done by the server when we
...
...
@@ -5675,6 +5672,14 @@ int main(int argc, char **argv)
server.
*/
err:
/* if --dump-slave , start the slave sql thread */
if
(
opt_slave_data
&&
do_start_slave_sql
(
mysql
))
goto
err
;
#ifdef HAVE_SMEM
my_free
(
shared_memory_base_name
);
#endif
dbDisconnect
(
current_host
);
if
(
!
path
)
write_footer
(
md_result_file
);
...
...
mysql-test/r/rpl_mysqldump_slave.result
View file @
74feebcd
...
...
@@ -11,4 +11,11 @@ START SLAVE;
STOP SLAVE;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
START SLAVE;
slave start;
Warnings:
Note 1254 Slave is already running
CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
slave start;
Warnings:
Note 1254 Slave is already running
include/rpl_end.inc
mysql-test/t/rpl_mysqldump_slave.test
View file @
74feebcd
...
...
@@ -27,4 +27,13 @@ connection slave;
# Execute mysqldump with --dump-slave ,--apply-slave-statements and --include-master-host-port
--
exec
$MYSQL_DUMP_SLAVE
--
compact
--
dump
-
slave
--
apply
-
slave
-
statements
--
include
-
master
-
host
-
port
test
#
# MDEV-5624 mysqldump --dump-slave option does not restart the replication if the dump has failed
#
slave
start
;
--
replace_regex
/
MASTER_LOG_POS
=
[
0
-
9
]
+/
MASTER_LOG_POS
=
BINLOG_START
/
--
error
2
--
exec
$MYSQL_DUMP_SLAVE
--
compact
--
dump
-
slave
no_such_db
slave
start
;
--
source
include
/
rpl_end
.
inc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment