-
Notifications
You must be signed in to change notification settings - Fork 203
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
- Prepare data
drop schema if exists up;
drop schema if exists down;
create schema up;
create schema down;
drop user if exists up;
drop user if exists down;
create user up;
create user down;
grant select on up.* to up;
grant select on down.* to down;
create table up.test (id bigint primary key, d double not null, a int not null);
create table down.test like up.test;
insert into up.test values (1, 0, 4);
insert into down.test values (1, 2, 3);- Set diff config
export-fix-sql = true
[data-sources.up]
host = "127.0.0.1"
port = 4000
user = "up"
password = ""
route-rules = ["rename"]
[data-sources.down]
host = "127.0.0.1"
port = 4000
user = "down"
password = ""
[routes]
[routes.rename]
schema-pattern = "up"
table-pattern = "test"
target-schema = "down"
target-table = "test"
[task]
output-dir = "./output"
source-instances = ["up"]
target-instance = "down"
target-check-tables = ["down.test"]- Run sync-diff. It should say "The data of `down`.`test` is not equal".
- Check the fix-sql content
cat output/fix-on-down/down:test:0:0-0:0.sql
2. What did you expect to see?
The column d in the fix-sql is 0.
3. What did you see instead?
The column d in the fix-sql is NULL:
-- table: down.test
-- range in sequence: Full
/*
DIFF COLUMNS ╏ `D` ╏ `A`
╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╋╍╍╍╍╍╍
source data ╏ NULL ╏ 4
╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╋╍╍╍╍╍╍
target data ╏ 2 ╏ 3
╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╋╍╍╍╍╍╍
*/
REPLACE INTO `down`.`test`(`id`,`d`,`a`) VALUES (1,NULL,4);