Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dm: update contents about wildcards #14695

Merged
merged 3 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dm/dm-binlog-event-filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ filters:

Starting from DM v2.0.2, you can configure the binlog event filter in the source configuration file. For details, see [Upstream Database Configuration File](/dm/dm-source-configuration-file.md).

In simple scenarios, it is recommended that you use the wildcard for matching schemas and tables. However, note the following version differences:
When you use the wildcard for matching schemas and tables, note the following:

- For DM v1.0.5 or later versions, the binlog event filter supports the [wildcard match](https://en.wikipedia.org/wiki/Glob_(programming)#Syntax), but there can be **only one** `*` in the wildcard expression, and `*` **must be placed at the end**.
- `schema-pattern` and `table-pattern` only support wildcards including `*`, `?` and `[]`. There can only be one `*` symbol in a wildcard match, and it must be at the end. For example, `table-pattern: "t_*"` indicates all tables starting with `t_`. See [wildcard matching](https://en.wikipedia.org/wiki/Glob_(programming)#Syntax) for details.

- For DM versions earlier than v1.0.5, the binlog event filter supports the wildcard but does not support the `[...]` and `[!...]` expressions.
- `sql-pattern` only supports regular expressions.

## Parameter descriptions

Expand Down
6 changes: 3 additions & 3 deletions dm/dm-block-allow-table-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ block-allow-list: # Use black-white-list if the DM version is earlie
- db-name: "~^test.*"
tbl-name: "~^t.*"
- db-name: "test"
tbl-name: "t"
tbl-name: "t*"
ignore-tables:
- db-name: "test"
tbl-name: "log"
```

In simple scenarios, it is recommended that you use the wildcard for matching schemas and tables. However, note the following version differences:

- For DM v1.0.5 or later versions, the block and allow lists support the [wildcard match](https://en.wikipedia.org/wiki/Glob_(programming)#Syntax), but there can be **only one** `*` in the wildcard expression, and `*` **must be placed at the end**.
- Wildcards including `*`, `?` and `[]` are supported. There can only be one `*` symbol in a wildcard match, and it must be at the end. For example, `tbl-name: "t*"` indicates all tables starting with `t`. See [wildcard matching](https://en.wikipedia.org/wiki/Glob_(programming)#Syntax) for details.

- For DM versions earlier than v1.0.5, the block and allow lists only support regular expression matching.
- A regular expression must begin with the `~` character.

## Parameter descriptions

Expand Down
8 changes: 5 additions & 3 deletions dm/dm-table-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ routes:
target-schema: "test"
```

In simple scenarios, it is recommended that you use the wildcard for matching schemas and tables. However, note the following version differences:
Regular expressions and wildcards are supported to match database and table names. In simple scenarios, it is recommended that you use the wildcard for matching schemas and tables. However, note the following:

- For DM v1.0.5 or later versions, the table routing supports the [wildcard match](https://en.wikipedia.org/wiki/Glob_(programming)#Syntax), but there can be **only one** `*` in the wildcard expression, and `*` **must be placed at the end**.
- Wildcards including `*`, `?` and `[]` are supported. There can only be one `*` symbol in a wildcard match, and it must be at the end. For example, `table-pattern: "t_*"` indicates all tables starting with `t_`. See [wildcard matching](https://en.wikipedia.org/wiki/Glob_(programming)#Syntax) for details.

- For DM versions earlier than v1.0.5, the table routing supports the wildcard but does not support the `[...]` and `[!...]` expressions.
- `table-regexp`, `schema-regexp`, and `source-regexp` only support regular expressions and cannot start with the `~` symbol.

- `schema-pattern` and `table-pattern` support both wildcards and regular expressions. Regular expressions must begin with the `~` symbol.

## Parameter descriptions

Expand Down
Loading