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
aa70d952
Commit
aa70d952
authored
Apr 07, 2008
by
skozlov/ksm@mysql.com/virtop.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpl_slave_status.test
Added waiting start/stop slave via primitives.
parent
a5d13561
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
45 deletions
+49
-45
mysql-test/suite/rpl/r/rpl_slave_status.result
mysql-test/suite/rpl/r/rpl_slave_status.result
+16
-16
mysql-test/suite/rpl/t/rpl_slave_status.test
mysql-test/suite/rpl/t/rpl_slave_status.test
+33
-29
No files found.
mysql-test/suite/rpl/r/rpl_slave_status.result
View file @
aa70d952
...
...
@@ -4,21 +4,21 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
grant replication slave on *.* to rpl@127.0.0.1 identified by
'rpl';
stop slave
;
change master to
master_user='rpl',master_password='rpl';
start slave
;
drop table if exists
t1;
create table
t1 (n int);
insert into t1 values
(1);
select * from
t1;
GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY
'rpl';
STOP SLAVE
;
CHANGE MASTER TO
master_user='rpl',master_password='rpl';
START SLAVE
;
DROP TABLE IF EXISTS
t1;
CREATE TABLE
t1 (n int);
INSERT INTO t1 VALUES
(1);
SELECT * FROM
t1;
n
1
delete from mysql.user where
user='rpl';
flush privileges
;
stop slave
;
start slave
;
show slave status
;
DELETE FROM mysql.user WHERE
user='rpl';
FLUSH PRIVILEGES
;
STOP SLAVE
;
START SLAVE
;
SHOW SLAVE STATUS
;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User rpl
...
...
@@ -57,6 +57,6 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
drop table
t1;
delete from mysql.user where
user='rpl';
drop table
t1;
DROP TABLE
t1;
DELETE FROM mysql.user WHERE
user='rpl';
DROP TABLE
t1;
mysql-test/suite/rpl/t/rpl_slave_status.test
View file @
aa70d952
--
source
include
/
master
-
slave
.
inc
############################################################################
# Test case for BUG#10780
#
# REQUIREMENT
# A slave without replication privileges should have Slave_IO_Running = No
############################################################################
--
source
include
/
master
-
slave
.
inc
# 1. Create new replication user
connection
master
;
grant
replication
slave
on
*.*
to
rpl
@
127.0
.
0.1
identified
by
'rpl'
;
--
connection
master
GRANT
REPLICATION
SLAVE
ON
*.*
TO
rpl
@
127.0
.
0.1
IDENTIFIED
BY
'rpl'
;
connection
slave
;
stop
slave
;
change
master
to
master_user
=
'rpl'
,
master_password
=
'rpl'
;
start
slave
;
--
connection
slave
STOP
SLAVE
;
--
source
include
/
wait_for_slave_to_stop
.
inc
CHANGE
MASTER
TO
master_user
=
'rpl'
,
master_password
=
'rpl'
;
START
SLAVE
;
--
source
include
/
wait_for_slave_to_start
.
inc
# 2. Do replication as new user
connection
master
;
--
connection
master
--
disable_warnings
drop
table
if
exists
t1
;
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
create
table
t1
(
n
int
);
insert
into
t1
values
(
1
);
save_master_pos
;
connection
slave
;
sync_with_master
;
select
*
from
t1
;
CREATE
TABLE
t1
(
n
int
);
INSERT
INTO
t1
VALUES
(
1
);
--
sync_slave_with_master
SELECT
*
FROM
t1
;
# 3. Delete new replication user
connection
master
;
delete
from
mysql
.
user
where
user
=
'rpl'
;
flush
privileges
;
connection
slave
;
--
connection
master
DELETE
FROM
mysql
.
user
WHERE
user
=
'rpl'
;
FLUSH
PRIVILEGES
;
--
connection
slave
# 4. Restart slave without privileges
# (slave.err will contain access denied error for this START SLAVE command)
stop
slave
;
start
slave
;
STOP
SLAVE
;
--
source
include
/
wait_for_slave_to_stop
.
inc
START
SLAVE
;
--
let
$slave_param
=
Slave_SQL_Running
--
let
$slave_param_value
=
Yes
--
source
include
/
wait_for_slave_param
.
inc
# 5. Make sure Slave_IO_Running = No
--
replace_result
$MASTER_MYPORT
MASTER_MYPORT
...
...
@@ -44,16 +48,16 @@ start slave;
# "Connecting to master" or "Waiting for master update"
--
replace_column
1
# 7 # 8 # 9 # 22 # 23 # 35 # 36 #
--
vertical_results
show
slave
status
;
SHOW
SLAVE
STATUS
;
# Cleanup (Note that slave IO thread is not running)
connection
slave
;
drop
table
t1
;
delete
from
mysql
.
user
where
user
=
'rpl'
;
--
connection
slave
DROP
TABLE
t1
;
DELETE
FROM
mysql
.
user
WHERE
user
=
'rpl'
;
# cleanup: slave io thread has been stopped "irrecoverably"
# so we clean up mess manually
connection
master
;
drop
table
t1
;
--
connection
master
DROP
TABLE
t1
;
#
e
nd of 4.1 tests
#
E
nd 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