Closed lichunzhu closed 3 years ago
When dumpling builds a where condition, if both --where
and --rows
are specified, dumpling will generate a where condition which is in the following format:
... WHERE ${where} AND ${chunks_split_sql}
which actually should be:
... WHERE (${where}) AND (${chunks_split_sql})
However, dump may dump incorrectly data if either of the following cases is matched:
--where
contains OR
operator. Dumpling changes (A∨B)∧C
directly to A∨B∧C
which breaks the distributivity law.${chunks_split_sql}
will contain OR
operator generated in https://github.com/pingcap/dumpling/blob/562cb6c021782ce3e35c279a611e7a381979acfd/v4/export/sql.go#L742
which will also breaks the distributivity law.(A∨B)∧C = (A∧C)∨(B∧C)
What did you do?
Use dumpling to dump TiDB v5.x data using the
--where
condition.What did you expect to see?
Dumpling only dumps data that match where condition.
What did you see instead?
Dumpling dumps some data out of where condition.
Versions of the cluster
Dumpling version (run
dumpling -V
):Other interesting information (system version, hardware config, etc):