Skip to content

Commit

Permalink
dm: update contents about wildcards (#14695) (#14760)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Sep 8, 2023
1 parent f3af22c commit dd8e571
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
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, in `table-pattern: "t_*"`, `"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, in `tbl-name: "t*"`, `"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, in `table-pattern: "t_*"`, `"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

0 comments on commit dd8e571

Please sign in to comment.