diff --git a/reparo/syncer/translate.go b/reparo/syncer/translate.go index 65681609e..5603c7e8e 100644 --- a/reparo/syncer/translate.go +++ b/reparo/syncer/translate.go @@ -48,11 +48,11 @@ func pbBinlogToTxn(binlog *pb.Binlog) (txn *loader.Txn, err error) { return nil, errors.Trace(err) } - _, newDatum, err := codec.DecodeOne(col.Value) + _, oldDatum, err := codec.DecodeOne(col.Value) if err != nil { return nil, errors.Trace(err) } - _, oldDatum, err := codec.DecodeOne(col.ChangedValue) + _, newDatum, err := codec.DecodeOne(col.ChangedValue) if err != nil { return nil, errors.Trace(err) } diff --git a/tests/reparo/run.sh b/tests/reparo/run.sh index 3d2882a9a..65a04869f 100755 --- a/tests/reparo/run.sh +++ b/tests/reparo/run.sh @@ -20,7 +20,7 @@ run_sql "CREATE TABLE \`reparo_test\`.\`test\`(\`id\` int, \`name\` varchar(10), run_sql "INSERT INTO \`reparo_test\`.\`test\` VALUES(1, 'a', 'a'), (2, 'b', 'b')" run_sql "INSERT INTO \`reparo_test\`.\`test\` VALUES(3, 'c', 'c'), (4, 'd', 'c')" run_sql "UPDATE \`reparo_test\`.\`test\` SET \`name\` = 'bb' where \`id\` = 2" -run_sql "DELETE FROM \`reparo_test\`.\`test\` WHERE \`name\` = 'bb'" +run_sql "DELETE FROM \`reparo_test\`.\`test\` WHERE \`id\` = '1'" run_sql "INSERT INTO \`reparo_test\`.\`test\` VALUES(5, 'e', 'e')" sleep 5