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
0907c913
Commit
0907c913
authored
Mar 25, 2011
by
Sven Sandberg
Browse files
Options
Browse Files
Download
Plain Diff
Merged BUG#11766427, BUG#59539 from 5.1 to 5.5.
No conflicts.
parents
49417455
f1b638d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
3 deletions
+43
-3
client/mysqlbinlog.cc
client/mysqlbinlog.cc
+11
-3
mysql-test/r/mysqlbinlog.result
mysql-test/r/mysqlbinlog.result
+12
-0
mysql-test/t/mysqlbinlog.test
mysql-test/t/mysqlbinlog.test
+20
-0
No files found.
client/mysqlbinlog.cc
View file @
0907c913
...
@@ -714,10 +714,18 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
...
@@ -714,10 +714,18 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
*/
*/
start_datetime
=
0
;
start_datetime
=
0
;
offset
=
0
;
// print everything and protect against cycling rec_count
offset
=
0
;
// print everything and protect against cycling rec_count
/*
Skip events according to the --server-id flag. However, don't
skip format_description or rotate events, because they they
are really "global" events that are relevant for the entire
binlog, even if they have a server_id. Also, we have to read
the format_description event so that we can parse subsequent
events.
*/
if
(
ev_type
!=
ROTATE_EVENT
&&
server_id
&&
(
server_id
!=
ev
->
server_id
))
goto
end
;
}
}
if
(
server_id
&&
(
server_id
!=
ev
->
server_id
))
/* skip just this event, continue processing the log. */
goto
end
;
if
(((
my_time_t
)(
ev
->
when
)
>=
stop_datetime
)
if
(((
my_time_t
)(
ev
->
when
)
>=
stop_datetime
)
||
(
pos
>=
stop_position_mot
))
||
(
pos
>=
stop_position_mot
))
{
{
...
...
mysql-test/r/mysqlbinlog.result
View file @
0907c913
...
@@ -903,3 +903,15 @@ master-bin.000002 # Query # # CREATE DATABASE test1
...
@@ -903,3 +903,15 @@ master-bin.000002 # Query # # CREATE DATABASE test1
master-bin.000002 # Query # # use `test1`; CREATE TABLE t1(id int)
master-bin.000002 # Query # # use `test1`; CREATE TABLE t1(id int)
master-bin.000002 # Query # # use `test1`; DROP TABLE `t1` /* generated by server */
master-bin.000002 # Query # # use `test1`; DROP TABLE `t1` /* generated by server */
master-bin.000002 # Query # # DROP DATABASE test1
master-bin.000002 # Query # # DROP DATABASE test1
RESET MASTER;
USE test;
CREATE TABLE t1 (a INT);
SET GLOBAL SERVER_ID = 2;
DROP TABLE t1;
FLUSH LOGS;
SHOW TABLES IN test;
Tables_in_test
t1
SHOW TABLES IN test;
Tables_in_test
SET GLOBAL SERVER_ID = 1;
mysql-test/t/mysqlbinlog.test
View file @
0907c913
...
@@ -527,3 +527,23 @@ exec $MYSQL_BINLOG $MYSQLD_DATADIR/$master_binlog | $MYSQL test 2>&1;
...
@@ -527,3 +527,23 @@ exec $MYSQL_BINLOG $MYSQLD_DATADIR/$master_binlog | $MYSQL test 2>&1;
let
$binlog_file
=
query_get_value
(
SHOW
MASTER
STATUS
,
File
,
1
);
let
$binlog_file
=
query_get_value
(
SHOW
MASTER
STATUS
,
File
,
1
);
source
include
/
show_binlog_events
.
inc
;
source
include
/
show_binlog_events
.
inc
;
#
# BUG#11766427 BUG#59530: Filter by server id in mysqlbinlog fails
# This test checks that the format description log event is not
# filtered out by the --server-id option.
#
RESET
MASTER
;
USE
test
;
CREATE
TABLE
t1
(
a
INT
);
--
let
$old_server_id
=
`SELECT @@GLOBAL.SERVER_ID`
SET
GLOBAL
SERVER_ID
=
2
;
DROP
TABLE
t1
;
--
let
$master_binlog
=
query_get_value
(
SHOW
MASTER
STATUS
,
File
,
1
)
FLUSH
LOGS
;
# The following should only create t1, not drop it.
--
exec
$MYSQL_BINLOG
--
server
-
id
=
1
$MYSQLD_DATADIR
/
$master_binlog
|
$MYSQL
SHOW
TABLES
IN
test
;
# The following should only drop t1, not create it.
--
exec
$MYSQL_BINLOG
--
server
-
id
=
2
$MYSQLD_DATADIR
/
$master_binlog
|
$MYSQL
SHOW
TABLES
IN
test
;
eval
SET
GLOBAL
SERVER_ID
=
$old_server_id
;
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