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
b03b38dd
Commit
b03b38dd
authored
Dec 16, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: rpl.rpl_row_mysqlbinlog
some trivial simplifications. drinking the ocean, one drop at a time
parent
e86580c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
119 deletions
+38
-119
mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
+13
-24
mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
+25
-95
No files found.
mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
View file @
b03b38dd
include/master-slave.inc
[connection
master]
---Setup Section --
set timestamp=1000000000;
DROP TABLE IF EXISTS t1,t2,t3;
CREATE TABLE t1(word VARCHAR(20));
CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY);
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT);
---Test1 check table load --
INSERT INTO t1 VALUES ("abirvalg");
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
set @d1 = 'dd1';
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
---Test 1 check table load --
SELECT COUNT(*) from t1;
COUNT(*)
351
...
...
@@ -71,9 +78,7 @@ c1 c3 c4 c5
5 2006-02-22 00:00:00 Tested in Texas 11
insert into t1 values ("Alas");
flush logs;
--- Test 1 Dump binlog to file --
--- Test 1 delete tables, clean master and slave --
DROP TABLE t1;
DROP TABLE t2;
...
...
@@ -84,9 +89,7 @@ reset master;
reset slave;
start slave;
include/wait_for_slave_to_start.inc
--- Test 1 Load from Dump binlog file --
--- Test 1 Check Load Results --
SELECT COUNT(*) from t1;
COUNT(*)
...
...
@@ -148,7 +151,6 @@ c1 c3 c4 c5
3 2006-02-22 00:00:00 Tested in Texas 6.6
4 2006-02-22 00:00:00 Tested in Texas 8.8
5 2006-02-22 00:00:00 Tested in Texas 11
--- Test 2 position test --
/*!50530
SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019
SET @@session.max_insert_delayed_threads=0*/;
...
...
@@ -172,7 +174,6 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003
SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530
SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
--- Test 3 First Remote test --
/*!50530
SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019
SET @@session.max_insert_delayed_threads=0*/;
...
...
@@ -189,9 +190,6 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
CREATE TABLE t1(word VARCHAR(20))
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
...
...
@@ -205,7 +203,6 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003
SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530
SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
--- Test 4 Second Remote test --
DROP TABLE t1;
DROP TABLE t2;
...
...
@@ -276,7 +273,6 @@ c1 c3 c4 c5
3 2006-02-22 00:00:00 Tested in Texas 6.6
4 2006-02-22 00:00:00 Tested in Texas 8.8
5 2006-02-22 00:00:00 Tested in Texas 11
--- Test 5 LOAD DATA --
/*!50530
SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019
SET @@session.max_insert_delayed_threads=0*/;
...
...
@@ -287,7 +283,6 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003
SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530
SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
--- Test 6 reading stdin --
/*!50530
SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019
SET @@session.max_insert_delayed_threads=0*/;
...
...
@@ -304,9 +299,6 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
CREATE TABLE t1(word VARCHAR(20))
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
...
...
@@ -320,7 +312,6 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003
SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530
SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
--- Test 7 reading stdin w/position --
/*!50530
SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019
SET @@session.max_insert_delayed_threads=0*/;
...
...
@@ -344,7 +335,6 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003
SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530
SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
--- Test 8 switch internal charset --
stop slave;
include/wait_for_slave_to_stop.inc
...
...
@@ -380,14 +370,13 @@ HEX(f)
select HEX(f) from t5;
HEX(f)
835C
--- Test cleanup --
DROP TABLE
IF EXISTS t1
;
DROP TABLE
t1, t2, t3, t04, t05, t4, t5
;
CREATE TABLE t1 (a INT NOT NULL KEY, b INT);
INSERT INTO t1 VALUES(1,1);
SELECT * FROM t1;
a b
1 1
FLUSH LOGS;
DROP TABLE
IF EXISTS t1, t2, t3, t04, t05, t4, t5
;
DROP TABLE
t1
;
include/rpl_end.inc
mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
View file @
b03b38dd
...
...
@@ -4,43 +4,27 @@
# Purpose: To test changes to mysqlbinlog for row based bin logs #
# We are using .opt file since we need small binlog size #
##################################################################
# Include Section
# Make sure that we have row based bin log
--
source
include
/
have_binlog_format_row
.
inc
# Embedded server doesn't support binlogging
--
source
include
/
not_embedded
.
inc
# This test requires the cp932 charset compiled in
--
source
include
/
have_cp932
.
inc
# Slow test, don't run during staging part
--
source
include
/
not_staging
.
inc
--
source
include
/
master
-
slave
.
inc
# Setup Section
# we need this for getting fixed timestamps inside of this test
--
disable_query_log
select
"---Setup Section --"
as
""
;
--
enable_query_log
--
echo
---
Setup
Section
--
# we need this for getting fixed timestamps inside of this test
set
timestamp
=
1000000000
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
,
t2
,
t3
;
--
enable_warnings
connection
master
;
CREATE
TABLE
t1
(
word
VARCHAR
(
20
));
CREATE
TABLE
t2
(
id
INT
AUTO_INCREMENT
NOT
NULL
PRIMARY
KEY
);
--
let
$
position
=
query_get_value
(
SHOW
MASTER
STATUS
,
Position
,
1
)
--
let
position
=
query_get_value
(
SHOW
MASTER
STATUS
,
Position
,
1
)
CREATE
TABLE
t3
(
c1
INT
NOT
NULL
PRIMARY
KEY
,
c2
LONGBLOB
,
c3
TIMESTAMP
,
c4
TEXT
,
c5
FLOAT
);
--
let
$stop_position
=
query_get_value
(
SHOW
MASTER
STATUS
,
Position
,
1
)
--
let
$stop_position1
=
`select $stop_position - 1`
--
let
$binlog_start_pos
=
query_get_value
(
SHOW
BINLOG
EVENTS
LIMIT
1
,
End_log_pos
,
1
)
--
let
stop_position
=
query_get_value
(
SHOW
MASTER
STATUS
,
Position
,
1
)
--
let
stop_position1
=
`select $stop_position - 1`
--
let
binlog_start_pos
=
query_get_value
(
SHOW
BINLOG
EVENTS
LIMIT
1
,
End_log_pos
,
1
)
# Test Section
# Lets start by putting some data into the tables.
--
disable_query_log
INSERT
INTO
t1
VALUES
(
"abirvalg"
);
LOAD
DATA
INFILE
'../../std_data/words.dat'
INTO
TABLE
t1
;
LOAD
DATA
INFILE
'../../std_data/words.dat'
INTO
TABLE
t1
;
...
...
@@ -54,7 +38,8 @@ set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
set
@
d1
=
concat
(
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
);
set
@
d1
=
concat
(
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
,
@
d1
);
let
$count
=
500
;
--
disable_query_log
let
count
=
500
;
while
(
$count
)
{
INSERT
INTO
t2
VALUES
(
NULL
);
...
...
@@ -63,10 +48,7 @@ while ($count)
}
--
enable_query_log
--
disable_query_log
select
"---Test1 check table load --"
as
""
;
--
enable_query_log
--
echo
---
Test
1
check
table
load
--
# Lets Check the tables on the Master
SELECT
COUNT
(
*
)
from
t1
;
...
...
@@ -95,34 +77,26 @@ insert into t1 values ("Alas");
flush
logs
;
# delimiters are for easier debugging in future
--
disable_query_log
select
"--- Test 1 Dump binlog to file --"
as
""
;
--
enable_query_log
--
echo
---
Test
1
Dump
binlog
to
file
--
#
# Prepare local temporary file to recreate what we have currently.
let
$
MYSQLD_DATADIR
=
`select @@datadir;`
;
let
MYSQLD_DATADIR
=
`select @@datadir;`
;
--
exec
$MYSQL_BINLOG
$MYSQLD_DATADIR
/
master
-
bin
.
000001
>
$MYSQLTEST_VARDIR
/
tmp
/
master
.
sql
--
exec
$MYSQL_BINLOG
$MYSQLD_DATADIR
/
master
-
bin
.
000002
>>
$MYSQLTEST_VARDIR
/
tmp
/
master
.
sql
# Now that we have our file, lets get rid of the current database.
# Cleanup the master and the slave and try to recreate.
--
disable_query_log
select
"--- Test 1 delete tables, clean master and slave --"
as
""
;
--
enable_query_log
--
echo
---
Test
1
delete
tables
,
clean
master
and
slave
--
DROP
TABLE
t1
;
DROP
TABLE
t2
;
DROP
TABLE
t3
;
sync_slave_with_master
;
#we expect STOP SLAVE to produce a warning as the slave is stopped
#(the server was started with skip-slave-start)
--
disable_warnings
stop
slave
;
--
source
include
/
wait_for_slave_to_stop
.
inc
--
enable_warnings
connection
master
;
reset
master
;
connection
slave
;
...
...
@@ -132,15 +106,11 @@ start slave;
connection
master
;
# We should be clean at this point, now we will run in the file from above.
--
disable_query_log
select
"--- Test 1 Load from Dump binlog file --"
as
""
;
--
enable_query_log
--
echo
---
Test
1
Load
from
Dump
binlog
file
--
--
exec
$MYSQL
-
e
"source
$MYSQLTEST_VARDIR
/tmp/master.sql"
--
disable_query_log
select
"--- Test 1 Check Load Results --"
as
""
;
--
enable_query_log
--
echo
---
Test
1
Check
Load
Results
--
# Lets Check the tables on the Master
SELECT
COUNT
(
*
)
from
t1
;
...
...
@@ -168,28 +138,20 @@ remove_file $MYSQLTEST_VARDIR/tmp/master.sql;
# this test for start-position option
# By setting this position to 416, we should only get the create of t3
--
disable_query_log
select
"--- Test 2 position test --"
as
""
;
--
enable_query_log
let
$MYSQLD_DATADIR
=
`select @@datadir;`
;
--
echo
---
Test
2
position
test
--
--
exec
$MYSQL_BINLOG
--
short
-
form
--
local
-
load
=
$MYSQLTEST_VARDIR
/
tmp
/
--
start
-
position
=
$position
--
stop
-
position
=
$stop_position
$MYSQLD_DATADIR
/
master
-
bin
.
000001
# These are tests for remote binlog.
# They should return the same as previous test.
--
disable_query_log
select
"--- Test 3 First Remote test --"
as
""
;
--
enable_query_log
--
echo
---
Test
3
First
Remote
test
--
# This is broken now
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
exec
$MYSQL_BINLOG
--
short
-
form
--
local
-
load
=
$MYSQLTEST_VARDIR
/
tmp
/
--
stop
-
position
=
$stop_position
--
read
-
from
-
remote
-
server
--
user
=
root
--
host
=
127.0
.
0.1
--
port
=
$MASTER_MYPORT
master
-
bin
.
000001
--
disable_query_log
select
"--- Test 4 Second Remote test --"
as
""
;
--
enable_query_log
--
echo
---
Test
4
Second
Remote
test
--
--
exec
$MYSQL_BINLOG
--
read
-
from
-
remote
-
server
--
user
=
root
--
host
=
127.0
.
0.1
--
port
=
$MASTER_MYPORT
master
-
bin
.
000001
>
$MYSQLTEST_VARDIR
/
tmp
/
remote
.
sql
--
exec
$MYSQL_BINLOG
--
read
-
from
-
remote
-
server
--
user
=
root
--
host
=
127.0
.
0.1
--
port
=
$MASTER_MYPORT
master
-
bin
.
000002
>>
$MYSQLTEST_VARDIR
/
tmp
/
remote
.
sql
# Now that we have our file, lets get rid of the current database.
...
...
@@ -201,13 +163,8 @@ DROP TABLE t3;
sync_slave_with_master
;
#we expect STOP SLAVE to produce a warning as the slave is stopped
#(the server was started with skip-slave-start)
--
disable_warnings
stop
slave
;
--
source
include
/
wait_for_slave_to_stop
.
inc
--
enable_warnings
connection
master
;
reset
master
;
connection
slave
;
...
...
@@ -251,40 +208,26 @@ connection master;
# transactions. /Matz
# LOAD DATA
--
disable_query_log
select
"--- Test 5 LOAD DATA --"
as
""
;
--
enable_query_log
--
echo
---
Test
5
LOAD
DATA
--
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
exec
$MYSQL_BINLOG
--
short
-
form
--
local
-
load
=
$MYSQLTEST_VARDIR
/
tmp
/
--
stop
-
position
=
$binlog_start_pos
--
read
-
from
-
remote
-
server
--
user
=
root
--
host
=
127.0
.
0.1
--
port
=
$MASTER_MYPORT
master
-
bin
.
000002
# Bug#7853 (mysqlbinlog does not accept input from stdin)
--
disable_query_log
select
"--- Test 6 reading stdin --"
as
""
;
--
enable_query_log
let
$MYSQLD_DATADIR
=
`select @@datadir;`
;
--
echo
---
Test
6
reading
stdin
--
--
replace_result
$MYSQL_TEST_DIR
MYSQL_TEST_DIR
--
exec
$MYSQL_BINLOG
--
short
-
form
--
stop
-
position
=
$stop_position1
-
<
$MYSQLD_DATADIR
/
master
-
bin
.
000001
--
disable_query_log
select
"--- Test 7 reading stdin w/position --"
as
""
;
--
enable_query_log
--
echo
---
Test
7
reading
stdin
w
/
position
--
--
replace_result
$MYSQL_TEST_DIR
MYSQL_TEST_DIR
--
exec
$MYSQL_BINLOG
--
short
-
form
--
start
-
position
=
$position
--
stop
-
position
=
$stop_position
-
<
$MYSQLD_DATADIR
/
master
-
bin
.
000001
# Bug#16217 (mysql client did not know how not switch its internal charset)
--
disable_query_log
select
"--- Test 8 switch internal charset --"
as
""
;
--
enable_query_log
--
echo
---
Test
8
switch
internal
charset
--
sync_slave_with_master
;
#we expect STOP SLAVE to produce a warning as the slave is stopped
#(the server was started with skip-slave-start)
--
disable_warnings
stop
slave
;
--
source
include
/
wait_for_slave_to_stop
.
inc
--
enable_warnings
connection
master
;
reset
master
;
connection
slave
;
...
...
@@ -297,7 +240,6 @@ create table t4 (f text character set utf8);
create
table
t5
(
f
text
character
set
cp932
);
--
exec
$MYSQL
--
default
-
character
-
set
=
utf8
test
-
e
"insert into t4 values(_utf8'ソ')"
--
exec
$MYSQL
--
default
-
character
-
set
=
cp932
test
-
e
"insert into t5 values(_cp932'\');"
let
$MYSQLD_DATADIR
=
`select @@datadir;`
;
flush
logs
;
rename
table
t4
to
t04
,
t5
to
t05
;
--
exec
$MYSQL_BINLOG
$MYSQLD_DATADIR
/
master
-
bin
.
000001
|
$MYSQL
--
default
-
character
-
set
=
utf8
...
...
@@ -314,42 +256,30 @@ select HEX(f) from t4;
select
HEX
(
f
)
from
t05
;
select
HEX
(
f
)
from
t5
;
--
disable_query_log
select
"--- Test cleanup --"
as
""
;
--
enable_query_log
--
echo
---
Test
cleanup
--
# clean up
connection
master
;
sync_slave_with_master
;
connection
master
;
DROP
TABLE
t1
,
t2
,
t3
,
t04
,
t05
,
t4
,
t5
;
# BUG#17654 also test mysqlbinlog to ensure it can read the binlog from a remote server
# and ensure that the results are the same as if read from a file (the same file).
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
CREATE
TABLE
t1
(
a
INT
NOT
NULL
KEY
,
b
INT
);
INSERT
INTO
t1
VALUES
(
1
,
1
);
SELECT
*
FROM
t1
;
let
$MYSQLD_DATADIR
=
`select @@datadir;`
;
FLUSH
LOGS
;
--
exec
$MYSQL_BINLOG
--
read
-
from
-
remote
-
server
--
user
=
root
--
host
=
127.0
.
0.1
--
port
=
$MASTER_MYPORT
master
-
bin
.
000001
>
$MYSQLTEST_VARDIR
/
tmp
/
remote
.
sql
--
exec
$MYSQL_BINLOG
$MYSQLD_DATADIR
/
master
-
bin
.
000001
>
$MYSQLTEST_VARDIR
/
tmp
/
local
.
sql
--
diff_files
$MYSQLTEST_VARDIR
/
tmp
/
local
.
sql
$MYSQLTEST_VARDIR
/
tmp
/
remote
.
sql
--
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
remote
.
sql
--
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
local
.
sql
DROP
TABLE
t1
;
DROP
TABLE
IF
EXISTS
t1
,
t2
,
t3
,
t04
,
t05
,
t4
,
t5
;
sync_slave_with_master
;
# 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