Skip to content

sync-diff-inspector: not support regex? #852

@NewOrForever

Description

@NewOrForever

Bug Report

I am currently performing data consistency validation after migrating from MySQL to TiDB. Below is the route rule, and the table-pattern uses the regular expression ~^core_delivery_([1-9]|[0-9])$. When executing the validation, an error occurs:

An error occurred while initializing diff: from upstream: please make sure the filter is correct.: the source has no table to be compared. target-table is wms_saas.core_delivery, please check log info in output_test1/sync_diff.log for full details.

The TiDB version is v8.5.1.
the below is my table-pattern regular expression

[routes.core_delivery-route-rule1]
schema-pattern = "test-shard-merge"
table-pattern = "~^core_delivery_([1-9]|[0-9])$"
target-schema = "test"
target-table = "core_delivery"

But if the table-pattern value is changed to the wildcard format core_delivery_[1-9], the validation proceeds normally. Is the sync_diff_inspector not support regular expression, how to use regular expression?

I have tried several ways:

  • ^core_delivery_([1-9]|[0-9])$ -> failed
  • /^core_delivery_([1-9]|[0-9])$/ -> failed

./sync_diff_inspector -V

App Name: sync_diff_inspector
Release Version: v7.5.5-1-g37c2dad
Git Commit Hash: 37c2dad9218826a114e3389ac1209367715383ea
Git Branch: HEAD
UTC Build Time: 2025-01-10 06:48:14
Go Version: go1.23.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions