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
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
Prepare data
dropschema if exists up;
dropschema if exists down;
createschemaup;
createschemadown;
dropuser if exists up;
dropuser if exists down;
createuserup;
createuserdown;
grantselecton up.* to up;
grant all on down.* to down;
createtableup.test (id bigintprimary key, d double, a int);
createtabledown.test likeup.test;
insert intoup.testvalues (1, 5, 4);
insert intodown.testvalues (1, 2, 3);
Note that the fix-sql generated by sync-diff uses the REPLACE statement, so the current behavior is arguably "expected" (as REPLACE = DELETE + INSERT)
-- table: down.test-- range in sequence: Full/* DIFF COLUMNS ╏ `A` ╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍ source data ╏ 4 ╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍ target data ╏ 3 ╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍*/
REPLACE INTO `down`.`test`(`id`,`a`) VALUES (1,4);
However, when we use ignore-columns in sync-diff-inspector, it is because diff cannot actually handle those data types (json, bit, blob, etc). So the behavior is not useful for users.
Instead of REPLACE, the generated fix-sql should either use INSERT INTO ON DUPLICATE to keep the original ignored column:
insert into test (id, a) values (1, 4) on duplicate key update id =values(id), a =values(a);
or just generate the full row to replace everything entirely (may be impossible when sync-diff just don't know how to serialize the column):
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
2. What did you expect to see?
The value of
d
is either unchanged (2) or becomes the upstream value (5).3. What did you see instead?
The value of
d
got replaced as the default value (NULL):The text was updated successfully, but these errors were encountered: