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
f189ccf5
Commit
f189ccf5
authored
Apr 23, 2012
by
Andrei Elkin
Browse files
Options
Browse Files
Download
Plain Diff
merge from 5.1 repo
parents
bd0c3806
cdaae169
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
1 deletion
+57
-1
mysql-test/suite/rpl/r/rpl_parallel_show_binlog_events_purge_logs.result
...e/rpl/r/rpl_parallel_show_binlog_events_purge_logs.result
+13
-0
mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
...ite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
+35
-0
sql/log.h
sql/log.h
+5
-0
sql/sql_repl.cc
sql/sql_repl.cc
+4
-1
No files found.
mysql-test/suite/rpl/r/rpl_parallel_show_binlog_events_purge_logs.result
0 → 100644
View file @
f189ccf5
include/master-slave.inc
[connection master]
[connection slave]
SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
SHOW BINLOG EVENTS;
[connection slave1]
SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
FLUSH LOGS;
SET DEBUG_SYNC= 'now SIGNAL end';
SET DEBUG_SYNC= 'RESET';
[connection slave]
SET DEBUG_SYNC= 'RESET';
include/rpl_end.inc
mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
0 → 100644
View file @
f189ccf5
# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER
#
# The function mysql_show_binlog_events has a local stack variable
# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however
# this variable goes out of scope and is destroyed before clean
# thd->current_linfo.
#
# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure
# that with the fix local variable linfo is valid along all
# mysql_show_binlog_events function scope.
#
--
source
include
/
have_debug_sync
.
inc
--
source
include
/
master
-
slave
.
inc
--
echo
[
connection
slave
]
--
connection
slave
SET
DEBUG_SYNC
=
'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end'
;
--
send
SHOW
BINLOG
EVENTS
--
connection
slave1
--
echo
[
connection
slave1
]
SET
DEBUG_SYNC
=
'now WAIT_FOR on_show_binlog_events'
;
FLUSH
LOGS
;
SET
DEBUG_SYNC
=
'now SIGNAL end'
;
SET
DEBUG_SYNC
=
'RESET'
;
--
echo
[
connection
slave
]
--
connection
slave
--
disable_result_log
--
reap
--
enable_result_log
SET
DEBUG_SYNC
=
'RESET'
;
--
connection
master
--
source
include
/
rpl_end
.
inc
sql/log.h
View file @
f189ccf5
...
...
@@ -130,6 +130,11 @@ extern TC_LOG_DUMMY tc_log_dummy;
class
Relay_log_info
;
/*
Note that we destroy the lock mutex in the desctructor here.
This means that object instances cannot be destroyed/go out of scope,
until we have reset thd->current_linfo to NULL;
*/
typedef
struct
st_log_info
{
char
log_file_name
[
FN_REFLEN
];
...
...
sql/sql_repl.cc
View file @
f189ccf5
...
...
@@ -1454,6 +1454,8 @@ bool mysql_show_binlog_events(THD* thd)
IO_CACHE
log
;
File
file
=
-
1
;
int
old_max_allowed_packet
=
thd
->
variables
.
max_allowed_packet
;
LOG_INFO
linfo
;
DBUG_ENTER
(
"mysql_show_binlog_events"
);
Log_event
::
init_show_field_list
(
&
field_list
);
...
...
@@ -1480,7 +1482,6 @@ bool mysql_show_binlog_events(THD* thd)
char
search_file_name
[
FN_REFLEN
],
*
name
;
const
char
*
log_file_name
=
lex_mi
->
log_file_name
;
pthread_mutex_t
*
log_lock
=
mysql_bin_log
.
get_log_lock
();
LOG_INFO
linfo
;
Log_event
*
ev
;
unit
->
set_limit
(
thd
->
lex
->
current_select
);
...
...
@@ -1572,6 +1573,8 @@ bool mysql_show_binlog_events(THD* thd)
pthread_mutex_unlock
(
log_lock
);
}
// Check that linfo is still on the function scope.
DEBUG_SYNC
(
thd
,
"after_show_binlog_events"
);
ret
=
FALSE
;
...
...
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