You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ It was developed to compare MySQL replicas, in particular for a MySQL InnoDB clu
8
8
9
9
The tool first retrieves schema information and ensures that tables can be compared. Two tables can be compared when they carry the same columns and the same primary keys. The tool issues warning when columns or primary keys are different type or different ordinal position.
10
10
11
-
The tool compares md5 of the row, simply speaking `select concat(pk1, pk2) PK, md5(concat(pk1, pk2, coalesce(c1, 'null'), coalesce(c2, 'null'), ...)) MD5 from mytable order by pk1, pk2`. If some primary keys are missing on either master or slave database, or md5 value is not matching, the tool reports the difference, showing the primary keys.
11
+
The tool compares md5 of the row, simply speaking `select concat(pk1, ',', pk2) PK, md5(concat(pk1, ',', pk2, ',', coalesce(c1, 'null'), ',', coalesce(c2, 'null'), ...)) MD5 from mytable order by pk1, pk2`. If some primary keys are missing on either master or slave database, or md5 value is not matching, the tool reports the difference, showing the primary keys.
12
12
13
13
The tool being optimized for tables very similar in content, it retrieves 1 row alternatively from master then slave table. As data is sorted by PK, it keeps a sorted list of differences (pk and md5 value) in memory. As soon as there is a match, any value lower than the match pair is immediately reported and removed from memory. Memory footprint shall then remain small.
14
14
@@ -22,7 +22,7 @@ For the automated test suite, install MySQL 5 or 8 on your local machine (127.0.
22
22
23
23
## Run
24
24
25
-
First download `mysql-connector-java-8.0.13.jar`[here](https://dev.mysql.com/downloads/connector/j/) and place this file in the path of MySQLDataCompare jar file. Have also JRE 1.7 or higher in the path.
25
+
First download `mysql-connector-java-8.0.16.jar`[here](https://dev.mysql.com/downloads/connector/j/) and place this file in the path of MySQLDataCompare jar file. Have also JRE 1.7 or higher in the path.
26
26
27
27
Simply issue the command `java -jar MySQLDataCompare-1.0.jar masterSchemaURL slaveSchemaURL1 [slaveSchemaURL2]`.
28
28
@@ -31,6 +31,7 @@ Here is a sample output from the test cases.
31
31
Running on a i5 laptop with SSD and MySQL 8, comparison took less than 8MB heap size and 1 minute for 7.5 million rows nearly similar schemas.
0 commit comments