Expression filter: UPDATE filter is ignored if all of update-old-value filters are empty #7774
Closed
Description
What did you do?
-
Prepare a table
-- upstream MySQL CREATE TABLE test.t (a BIGINT PRIMARY KEY, r VARCHAR(10), s INT); INSERT INTO test.t VALUES (1, 'a', 2); -- downstream TiDB CREATE TABLE test.t (a BIGINT PRIMARY KEY, r VARCHAR(10), s INT); INSERT INTO test.t VALUES (1, 'a', 2);
-
Create a task which only the update-new-value filter is specified
expression-filter: e02: schema: test table: t update-new-value-expr: "r = 'a'" mysql-instances: - source-id: mysql-replica-01 expression-filters: ['e02'] ...
-
In the upstream MySQL, execute an UPDATE statement
-- Upstream MySQL UPDATE test.t SET s = s + 1 WHERE a = 1;
What did you expect to see?
The UPDATE DML should be skipped, because the changed row has r = 'a'
.
What did you see instead?
The DML is actually synchronized, i.e. SELECTing the row gives s = 3
.
Versions of the cluster
v6.3.0
current status of DM cluster (execute query-status <task-name>
in dmctl)
No response