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
c7adab80
Commit
c7adab80
authored
Jul 20, 2011
by
Alfranio Correia
Browse files
Options
Browse Files
Download
Plain Diff
merge mysql-5.5 (local) --> mysql-5.5
parents
9b6930ec
e94de17f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
5 deletions
+71
-5
mysql-test/extra/rpl_tests/rpl_reset_slave.test
mysql-test/extra/rpl_tests/rpl_reset_slave.test
+27
-1
mysql-test/suite/rpl/r/rpl_row_reset_slave.result
mysql-test/suite/rpl/r/rpl_row_reset_slave.result
+8
-0
mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
+8
-0
sql/rpl_mi.cc
sql/rpl_mi.cc
+13
-1
sql/rpl_mi.h
sql/rpl_mi.h
+1
-1
sql/sql_lex.h
sql/sql_lex.h
+5
-0
sql/sql_repl.cc
sql/sql_repl.cc
+3
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+6
-0
No files found.
mysql-test/extra/rpl_tests/rpl_reset_slave.test
View file @
c7adab80
...
...
@@ -77,5 +77,31 @@ reset slave;
source
include
/
check_slave_no_error
.
inc
;
change
master
to
master_user
=
'root'
;
--
let
$rpl_only_running_threads
=
1
#
# BUG#11809016 - NO WAY TO DISCOVER AN INSTANCE IS NO LONGER A SLAVE FOLLOWING MYSQL BUG#28796
#
reset
slave
;
--
source
include
/
start_slave
.
inc
--
source
include
/
stop_slave
.
inc
--
let
$_slave_master_host
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Master_Host
,
1
)
--
let
$_slave_master_user
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Master_User
,
1
)
--
let
$_slave_master_port
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Master_Port
,
1
)
reset
slave
all
;
--
error
ER_BAD_SLAVE
start
slave
;
--
let
$_show_master_host
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Master_Host
,
1
)
if
(
$_show_master_host
!=
No
such
row
)
{
die
;
}
--
replace_result
$_slave_master_host
MASTER_HOST
$_slave_master_user
MASTER_USER
$_slave_master_port
MASTER_PORT
--
eval
CHANGE
MASTER
TO
MASTER_HOST
=
'$_slave_master_host'
,
MASTER_USER
=
'$_slave_master_user'
,
MASTER_PORT
=
$_slave_master_port
--
source
include
/
start_slave
.
inc
--
source
include
/
rpl_end
.
inc
mysql-test/suite/rpl/r/rpl_row_reset_slave.result
View file @
c7adab80
...
...
@@ -41,4 +41,12 @@ include/stop_slave_sql.inc
reset slave;
include/check_slave_no_error.inc
change master to master_user='root';
reset slave;
include/start_slave.inc
include/stop_slave.inc
reset slave all;
start slave;
ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
include/start_slave.inc
include/rpl_end.inc
mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
View file @
c7adab80
...
...
@@ -41,4 +41,12 @@ include/stop_slave_sql.inc
reset slave;
include/check_slave_no_error.inc
change master to master_user='root';
reset slave;
include/start_slave.inc
include/stop_slave.inc
reset slave all;
start slave;
ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
include/start_slave.inc
include/rpl_end.inc
sql/rpl_mi.cc
View file @
c7adab80
...
...
@@ -31,6 +31,8 @@ int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
int
init_floatvar_from_file
(
float
*
var
,
IO_CACHE
*
f
,
float
default_val
);
int
init_dynarray_intvar_from_file
(
DYNAMIC_ARRAY
*
arr
,
IO_CACHE
*
f
);
static
void
init_master_log_pos
(
Master_info
*
mi
);
Master_info
::
Master_info
(
bool
is_slave_recovery
)
:
Slave_reporting_capability
(
"I/O"
),
ssl
(
0
),
ssl_verify_server_cert
(
0
),
fd
(
-
1
),
io_thd
(
0
),
...
...
@@ -100,6 +102,16 @@ bool Master_info::shall_ignore_server_id(ulong s_id)
!=
NULL
;
}
void
Master_info
::
clear_in_memory_info
(
bool
all
)
{
init_master_log_pos
(
this
);
if
(
all
)
{
port
=
MYSQL_PORT
;
host
[
0
]
=
0
;
user
[
0
]
=
0
;
password
[
0
]
=
0
;
}
}
void
init_master_log_pos
(
Master_info
*
mi
)
{
DBUG_ENTER
(
"init_master_log_pos"
);
...
...
@@ -234,7 +246,7 @@ file '%s')", fname);
}
mi
->
fd
=
fd
;
init_master_log_pos
(
mi
);
mi
->
clear_in_memory_info
(
false
);
}
else
// file exists
...
...
sql/rpl_mi.h
View file @
c7adab80
...
...
@@ -62,6 +62,7 @@ class Master_info : public Slave_reporting_capability
Master_info
(
bool
is_slave_recovery
);
~
Master_info
();
bool
shall_ignore_server_id
(
ulong
s_id
);
void
clear_in_memory_info
(
bool
all
);
/* the variables below are needed because we can change masters on the fly */
char
master_log_name
[
FN_REFLEN
];
...
...
@@ -113,7 +114,6 @@ class Master_info : public Slave_reporting_capability
DYNAMIC_ARRAY
ignore_server_ids
;
ulong
master_id
;
};
void
init_master_log_pos
(
Master_info
*
mi
);
int
init_master_info
(
Master_info
*
mi
,
const
char
*
master_info_fname
,
const
char
*
slave_info_fname
,
bool
abort_if_no_master_info_file
,
...
...
sql/sql_lex.h
View file @
c7adab80
...
...
@@ -294,6 +294,10 @@ typedef struct st_lex_master_info
DYNAMIC_ARRAY
repl_ignore_server_ids
;
}
LEX_MASTER_INFO
;
typedef
struct
st_lex_reset_slave
{
bool
all
;
}
LEX_RESET_SLAVE
;
enum
sub_select_type
{
...
...
@@ -2232,6 +2236,7 @@ struct LEX: public Query_tables_list
LEX_MASTER_INFO
mi
;
// used by CHANGE MASTER
LEX_SERVER_OPTIONS
server_options
;
USER_RESOURCES
mqh
;
LEX_RESET_SLAVE
reset_slave_info
;
ulong
type
;
/*
This variable is used in post-parse stage to declare that sum-functions,
...
...
sql/sql_repl.cc
View file @
c7adab80
...
...
@@ -1285,8 +1285,9 @@ int reset_slave(THD *thd, Master_info* mi)
goto
err
;
}
/* Clear master's log coordinates */
init_master_log_pos
(
mi
);
/* Clear master's log coordinates and associated information */
mi
->
clear_in_memory_info
(
thd
->
lex
->
reset_slave_info
.
all
);
/*
Reset errors (the idea is that we forget about the
old master).
...
...
sql/sql_yacc.yy
View file @
c7adab80
...
...
@@ -11337,10 +11337,16 @@ reset_options:
reset_option:
SLAVE { Lex->type|= REFRESH_SLAVE; }
slave_reset_options { }
| MASTER_SYM { Lex->type|= REFRESH_MASTER; }
| QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE;}
;
slave_reset_options:
/* empty */ { Lex->reset_slave_info.all= false; }
| ALL { Lex->reset_slave_info.all= true; }
;
purge:
PURGE
{
...
...
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