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
6e761b19
Commit
6e761b19
authored
May 27, 2008
by
Davi Arnaut
Browse files
Options
Browse Files
Download
Plain Diff
Merge.
parents
f4b291c5
25bddd93
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
70 deletions
+57
-70
mysql-test/suite/rpl/r/rpl_slave_status.result
mysql-test/suite/rpl/r/rpl_slave_status.result
+15
-41
mysql-test/suite/rpl/t/rpl_slave_status.test
mysql-test/suite/rpl/t/rpl_slave_status.test
+42
-29
No files found.
mysql-test/suite/rpl/r/rpl_slave_status.result
View file @
6e761b19
...
@@ -4,59 +4,33 @@ reset master;
...
@@ -4,59 +4,33 @@ reset master;
reset slave;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
start slave;
==== Create new replication user ====
[on master]
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
[on slave]
stop slave;
stop slave;
change master to master_user='rpl',master_password='rpl';
change master to master_user='rpl',master_password='rpl';
start slave;
start slave;
drop table if exists t1;
==== Do replication as new user ====
[on master]
create table t1 (n int);
create table t1 (n int);
insert into t1 values (1);
insert into t1 values (1);
[on slave]
select * from t1;
select * from t1;
n
n
1
1
delete from mysql.user where user='rpl';
==== Delete new replication user ====
[on master]
drop user rpl@127.0.0.1;
flush privileges;
flush privileges;
[on slave]
==== Restart slave without privileges =====
stop slave;
stop slave;
start slave;
start slave;
show slave status;
==== Verify that Slave_IO_Running = No ====
Slave_IO_State #
Slave_IO_Running = No (should be No)
Master_Host 127.0.0.1
==== Cleanup (Note that slave IO thread is not running) ====
Master_User rpl
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running No
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master NULL
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
drop table t1;
drop table t1;
delete from mysql.user where user='rpl';
delete from mysql.user where user='rpl';
[on master]
drop table t1;
drop table t1;
mysql-test/suite/rpl/t/rpl_slave_status.test
View file @
6e761b19
--
source
include
/
master
-
slave
.
inc
# ==== Purpose ====
#
############################################################################
# Verify that a slave without replication privileges has
# Test case for BUG#10780
# Slave_IO_Running = No
#
# ==== Method ====
#
# We do the following steps:
# - Create a new replication user on master
# - Connect to slave and start replication as this user.
# - Verify that slave can replicate well, by creating a table and
# inserting a row into it.
# - Delete the user from the master.
# - Stop and start the slave (this should fail).
# - Check the Slave_IO_Running column of SHOW SLAVE STATUS.
#
# ==== Related bugs ====
#
#
# REQUIREMENT
# BUG#10780: slave can't connect to master - IO and SQL threads running
# A slave without replication privileges should have Slave_IO_Running = No
# 1. Create new replication user
--
source
include
/
master
-
slave
.
inc
--
echo
====
Create
new
replication
user
====
--
echo
[
on
master
]
connection
master
;
connection
master
;
grant
replication
slave
on
*.*
to
rpl
@
127.0
.
0.1
identified
by
'rpl'
;
grant
replication
slave
on
*.*
to
rpl
@
127.0
.
0.1
identified
by
'rpl'
;
connection
slave
;
--
echo
[
on
slave
]
sync_slave_with_master
;
stop
slave
;
stop
slave
;
source
include
/
wait_for_slave_to_stop
.
inc
;
change
master
to
master_user
=
'rpl'
,
master_password
=
'rpl'
;
change
master
to
master_user
=
'rpl'
,
master_password
=
'rpl'
;
start
slave
;
start
slave
;
source
include
/
wait_for_slave_to_start
.
inc
;
# 2. Do replication as new user
--
echo
====
Do
replication
as
new
user
====
--
echo
[
on
master
]
connection
master
;
connection
master
;
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
create
table
t1
(
n
int
);
create
table
t1
(
n
int
);
insert
into
t1
values
(
1
);
insert
into
t1
values
(
1
);
save_master_pos
;
--
echo
[
on
slave
]
connection
slave
;
sync_slave_with_master
;
sync_with_master
;
select
*
from
t1
;
select
*
from
t1
;
# 3. Delete new replication user
--
echo
====
Delete
new
replication
user
====
--
echo
[
on
master
]
connection
master
;
connection
master
;
d
elete
from
mysql
.
user
where
user
=
'rpl'
;
d
rop
user
rpl
@
127.0
.
0.1
;
flush
privileges
;
flush
privileges
;
connection
slave
;
# 4. Restart slave without privileges
--
echo
[
on
slave
]
sync_slave_with_master
;
--
echo
====
Restart
slave
without
privileges
=====
# (slave.err will contain access denied error for this START SLAVE command)
# (slave.err will contain access denied error for this START SLAVE command)
stop
slave
;
stop
slave
;
source
include
/
wait_for_slave_to_stop
.
inc
;
source
include
/
wait_for_slave_to_stop
.
inc
;
start
slave
;
start
slave
;
source
include
/
wait_for_slave_sql_to_start
.
inc
;
source
include
/
wait_for_slave_sql_to_start
.
inc
;
# 5. Make sure Slave_IO_Running = No
--
echo
====
Verify
that
Slave_IO_Running
=
No
====
--
replace_result
$MASTER_MYPORT
MASTER_MYPORT
let
$result
=
query_get_value
(
"SHOW SLAVE STATUS"
,
Slave_IO_Running
,
1
);
# Column 1 is replaced, since the output can be either
--
echo
Slave_IO_Running
=
$result
(
should
be
No
)
# "Connecting to master" or "Waiting for master update"
--
replace_column
1
# 7 # 8 # 9 # 22 # 23 # 35 # 36 #
query_vertical
show
slave
status
;
# Cleanup (Note that slave IO thread is not running)
--
echo
====
Cleanup
(
Note
that
slave
IO
thread
is
not
running
)
====
connection
slave
;
drop
table
t1
;
drop
table
t1
;
delete
from
mysql
.
user
where
user
=
'rpl'
;
delete
from
mysql
.
user
where
user
=
'rpl'
;
# cleanup: slave io thread has been stopped "irrecoverably"
# cleanup: slave io thread has been stopped "irrecoverably"
# so we clean up mess manually
# so we clean up mess manually
--
echo
[
on
master
]
connection
master
;
connection
master
;
drop
table
t1
;
drop
table
t1
;
# end of 4.1 tests
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