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
effb7f89
Commit
effb7f89
authored
Jun 29, 2007
by
msvensson@pilot.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#28356 Exec'ing "diff" from "mysqltest" loses the output, no information available
- Use SQL for diffing master and slave
parent
b9d2e744
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
20 deletions
+38
-20
mysql-test/r/rpl_misc_functions.result
mysql-test/r/rpl_misc_functions.result
+12
-4
mysql-test/t/rpl_misc_functions.test
mysql-test/t/rpl_misc_functions.test
+26
-16
No files found.
mysql-test/r/rpl_misc_functions.result
View file @
effb7f89
...
...
@@ -40,7 +40,15 @@ CALL test_replication_sp2();
INSERT INTO t1 VALUES (test_replication_sf());
INSERT INTO t1 VALUES (test_replication_sf());
INSERT INTO t1 VALUES (test_replication_sf());
DROP PROCEDURE IF EXISTS test_replication_sp1;
DROP PROCEDURE IF EXISTS test_replication_sp2;
DROP FUNCTION IF EXISTS test_replication_sf;
DROP TABLE IF EXISTS t1;
select * from t1 into outfile "../tmp/t1_slave.txt";
create temporary table t1_slave select * from t1 where 1=0;
load data infile '../tmp/t1_slave.txt' into table t1_slave;
select count(*) into @aux from t1, t1_slave
where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ;
SELECT @aux;
@aux
12
DROP PROCEDURE test_replication_sp1;
DROP PROCEDURE test_replication_sp2;
DROP FUNCTION test_replication_sf;
DROP TABLE t1, t1_slave;
mysql-test/t/rpl_misc_functions.test
View file @
effb7f89
...
...
@@ -77,27 +77,37 @@ INSERT INTO t1 VALUES (test_replication_sf());
INSERT
INTO
t1
VALUES
(
test_replication_sf
());
INSERT
INTO
t1
VALUES
(
test_replication_sf
());
# Record the results of the query on the master
--
exec
$MYSQL
--
port
=
$MASTER_MYPORT
test
-
e
"SELECT * FROM test.t1"
>
$MYSQLTEST_VARDIR
/
tmp
/
rpl_rand_master
.
sql
--
sync_slave_with_master
#
Record the results of the query on the
slave
--
exec
$MYSQL
--
port
=
$SLAVE_MYPORT
test
-
e
"SELECT * FROM test.t1"
>
$MYSQLTEST_VARDIR
/
tmp
/
rpl_rand_slave
.
sql
#
Dump table on
slave
select
*
from
t1
into
outfile
"../tmp/t1_slave.txt"
;
# Compare the results from the master to the slave.
--
exec
diff
$MYSQLTEST_VARDIR
/
tmp
/
rpl_rand_master
.
sql
$MYSQLTEST_VARDIR
/
tmp
/
rpl_rand_slave
.
sql
# Load data from slave into temp table on master
connection
master
;
create
temporary
table
t1_slave
select
*
from
t1
where
1
=
0
;
load
data
infile
'../tmp/t1_slave.txt'
into
table
t1_slave
;
--
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
t1_slave
.
txt
# Compare master and slave temp table, use subtraction
# for floating point comparison of "double"
select
count
(
*
)
into
@
aux
from
t1
,
t1_slave
where
ABS
(
t1
.
col_a
-
t1_slave
.
col_a
)
<
0.0001
;
SELECT
@
aux
;
if
(
`SELECT @aux <> 12 OR @aux IS NULL`
)
{
--
echo
# ERROR: We expected to get count(*) = 12.
SELECT
col_a
FROM
t1
;
SELECT
col_a
FROM
t1_slave
;
--
echo
# abort
exit
;
}
# Cleanup
connection
master
;
--
disable_warnings
DROP
PROCEDURE
IF
EXISTS
test_replication_sp1
;
DROP
PROCEDURE
IF
EXISTS
test_replication_sp2
;
DROP
FUNCTION
IF
EXISTS
test_replication_sf
;
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
DROP
PROCEDURE
test_replication_sp1
;
DROP
PROCEDURE
test_replication_sp2
;
DROP
FUNCTION
test_replication_sf
;
DROP
TABLE
t1
,
t1_slave
;
--
sync_slave_with_master
# If all is good, when can cleanup our dump files.
--
system
rm
$MYSQLTEST_VARDIR
/
tmp
/
rpl_rand_master
.
sql
--
system
rm
$MYSQLTEST_VARDIR
/
tmp
/
rpl_rand_slave
.
sql
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