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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d1114834
Commit
d1114834
authored
Feb 26, 2010
by
Andrei Elkin
Browse files
Options
Browse Files
Download
Plain Diff
merging fixes of bug@51089 to 5.1-bt
parents
a0723c06
c23aee47
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
122 additions
and
2 deletions
+122
-2
mysql-test/include/test_fieldsize.inc
mysql-test/include/test_fieldsize.inc
+1
-1
mysql-test/suite/rpl/r/rpl_show_slave_running.result
mysql-test/suite/rpl/r/rpl_show_slave_running.result
+42
-0
mysql-test/suite/rpl/t/rpl_show_slave_running.test
mysql-test/suite/rpl/t/rpl_show_slave_running.test
+76
-0
sql/mysqld.cc
sql/mysqld.cc
+2
-1
sql/slave.cc
sql/slave.cc
+1
-0
No files found.
mysql-test/include/test_fieldsize.inc
View file @
d1114834
...
@@ -22,7 +22,7 @@ eval $test_insert;
...
@@ -22,7 +22,7 @@ eval $test_insert;
connection
slave
;
connection
slave
;
START
SLAVE
;
START
SLAVE
;
wait_for_slave_to_stop
;
--
source
include
/
wait_for_slave_sql_to_stop
.
inc
--
replace_result
$MASTER_MYPORT
MASTER_PORT
--
replace_result
$MASTER_MYPORT
MASTER_PORT
--
replace_column
1
# 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--
replace_column
1
# 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--
query_vertical
SHOW
SLAVE
STATUS
--
query_vertical
SHOW
SLAVE
STATUS
...
...
mysql-test/suite/rpl/r/rpl_show_slave_running.result
0 → 100644
View file @
d1114834
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
include/stop_slave.inc
SELECT GET_LOCK("debug_lock.before_get_running_status_yes", 1000);
GET_LOCK("debug_lock.before_get_running_status_yes", 1000)
1
set global debug= 'd,debug_lock.before_get_running_status_yes';
Slave_running, Slave_IO_Running, Slave_SQL_Running, must be OFF, NO, NO in three following queries
SHOW STATUS LIKE 'Slave_running';
Variable_name Value
Slave_running OFF
Slave_IO_Running= No
Slave_IO_Running= No
start slave io_thread;
Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF NO NO in three following queries
SHOW STATUS LIKE 'Slave_running';
Variable_name Value
Slave_running OFF
Slave_IO_Running= No
Slave_IO_Running= No
SELECT RELEASE_LOCK("debug_lock.before_get_running_status_yes");
RELEASE_LOCK("debug_lock.before_get_running_status_yes")
1
Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF YES NO in three following queries
SHOW STATUS LIKE 'Slave_running';
Variable_name Value
Slave_running OFF
Slave_IO_Running= Yes
Slave_IO_Running= No
start slave sql_thread;
Slave_running, Slave_IO_Running, Slave_SQL_Running must be ON, YES, YES in three following queries
SHOW STATUS LIKE 'Slave_running';
Variable_name Value
Slave_running ON
Slave_IO_Running= Yes
Slave_IO_Running= Yes
set global debug= '';
End of tests
mysql-test/suite/rpl/t/rpl_show_slave_running.test
0 → 100644
View file @
d1114834
#
# Bug #30703 SHOW STATUS LIKE 'Slave_running' is not compatible with `SHOW SLAVE STATUS'
# The test verifies that SHOW STATUS LIKE 'Slave_running' displays ON
# if and only if `SHOW SLAVE STATUS' displays YES for Slave_IO_Running and Slave_SQL_Running
#
source
include
/
master
-
slave
.
inc
;
source
include
/
have_debug
.
inc
;
connection
slave
;
source
include
/
stop_slave
.
inc
;
let
$debug_saved
=
`select @@global.debug`
;
let
$debug_lock
=
"debug_lock.before_get_running_status_yes"
;
eval
SELECT
GET_LOCK
(
$debug_lock
,
1000
);
set
global
debug
=
'd,debug_lock.before_get_running_status_yes'
;
# Test 1. Slave is stopped
--
echo
Slave_running
,
Slave_IO_Running
,
Slave_SQL_Running
,
must
be
OFF
,
NO
,
NO
in
three
following
queries
SHOW
STATUS
LIKE
'Slave_running'
;
let
$status
=
query_get_value
(
"show slave status"
,
Slave_IO_Running
,
1
);
echo
Slave_IO_Running
=
$status
;
let
$status
=
query_get_value
(
"show slave status"
,
Slave_SQL_Running
,
1
);
echo
Slave_IO_Running
=
$status
;
# Test 2. The slave IO thread is started but not yet got connected to master
# and SQL thread is not started
start
slave
io_thread
;
--
echo
Slave_running
,
Slave_IO_Running
,
Slave_SQL_Running
must
be
OFF
NO
NO
in
three
following
queries
SHOW
STATUS
LIKE
'Slave_running'
;
let
$status
=
query_get_value
(
"show slave status"
,
Slave_IO_Running
,
1
);
echo
Slave_IO_Running
=
$status
;
let
$status
=
query_get_value
(
"show slave status"
,
Slave_SQL_Running
,
1
);
echo
Slave_IO_Running
=
$status
;
# Test 3. The slave IO thread is started and got connected to master
# and SQL thread is still not started
eval
SELECT
RELEASE_LOCK
(
$debug_lock
);
let
$slave_param
=
Slave_IO_Running
;
let
$slave_param_value
=
YES
;
source
include
/
wait_for_slave_param
.
inc
;
--
echo
Slave_running
,
Slave_IO_Running
,
Slave_SQL_Running
must
be
OFF
YES
NO
in
three
following
queries
SHOW
STATUS
LIKE
'Slave_running'
;
let
$status
=
query_get_value
(
"show slave status"
,
Slave_IO_Running
,
1
);
echo
Slave_IO_Running
=
$status
;
let
$status
=
query_get_value
(
"show slave status"
,
Slave_SQL_Running
,
1
);
echo
Slave_IO_Running
=
$status
;
# Test 4. The slave IO thread is started and got connected to master
# and SQL thread is started
start
slave
sql_thread
;
source
include
/
wait_for_slave_sql_to_start
.
inc
;
--
echo
Slave_running
,
Slave_IO_Running
,
Slave_SQL_Running
must
be
ON
,
YES
,
YES
in
three
following
queries
SHOW
STATUS
LIKE
'Slave_running'
;
let
$status
=
query_get_value
(
"show slave status"
,
Slave_IO_Running
,
1
);
echo
Slave_IO_Running
=
$status
;
let
$status
=
query_get_value
(
"show slave status"
,
Slave_SQL_Running
,
1
);
echo
Slave_IO_Running
=
$status
;
# cleanup
connection
slave
;
eval
set
global
debug
=
'$debug_saved'
;
--
echo
End
of
tests
sql/mysqld.cc
View file @
d1114834
...
@@ -7162,7 +7162,8 @@ static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff)
...
@@ -7162,7 +7162,8 @@ static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff)
var
->
type
=
SHOW_MY_BOOL
;
var
->
type
=
SHOW_MY_BOOL
;
pthread_mutex_lock
(
&
LOCK_active_mi
);
pthread_mutex_lock
(
&
LOCK_active_mi
);
var
->
value
=
buff
;
var
->
value
=
buff
;
*
((
my_bool
*
)
buff
)
=
(
my_bool
)
(
active_mi
&&
active_mi
->
slave_running
&&
*
((
my_bool
*
)
buff
)
=
(
my_bool
)
(
active_mi
&&
active_mi
->
slave_running
==
MYSQL_SLAVE_RUN_CONNECT
&&
active_mi
->
rli
.
slave_running
);
active_mi
->
rli
.
slave_running
);
pthread_mutex_unlock
(
&
LOCK_active_mi
);
pthread_mutex_unlock
(
&
LOCK_active_mi
);
return
0
;
return
0
;
...
...
sql/slave.cc
View file @
d1114834
...
@@ -2557,6 +2557,7 @@ pthread_handler_t handle_slave_io(void *arg)
...
@@ -2557,6 +2557,7 @@ pthread_handler_t handle_slave_io(void *arg)
connected:
connected:
DBUG_SYNC_POINT
(
"debug_lock.before_get_running_status_yes"
,
10
);
// TODO: the assignment below should be under mutex (5.0)
// TODO: the assignment below should be under mutex (5.0)
mi
->
slave_running
=
MYSQL_SLAVE_RUN_CONNECT
;
mi
->
slave_running
=
MYSQL_SLAVE_RUN_CONNECT
;
thd
->
slave_net
=
&
mysql
->
net
;
thd
->
slave_net
=
&
mysql
->
net
;
...
...
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