From c1e2c08d4ac160ae56a34094e86d921955771c8e Mon Sep 17 00:00:00 2001 From: xixirangrang <35301108+hfxsd@users.noreply.github.com> Date: Mon, 4 Sep 2023 11:06:06 +0800 Subject: [PATCH 1/3] initial draft --- dm/dm-binlog-event-filter.md | 6 +++--- dm/dm-block-allow-table-lists.md | 6 +++--- dm/dm-table-routing.md | 8 +++++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dm/dm-binlog-event-filter.md b/dm/dm-binlog-event-filter.md index 8ce2a0d9c1e9c..6671636ab9018 100644 --- a/dm/dm-binlog-event-filter.md +++ b/dm/dm-binlog-event-filter.md @@ -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 diff --git a/dm/dm-block-allow-table-lists.md b/dm/dm-block-allow-table-lists.md index 0f09f40da5a21..6288c01410af9 100644 --- a/dm/dm-block-allow-table-lists.md +++ b/dm/dm-block-allow-table-lists.md @@ -28,7 +28,7 @@ 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" @@ -36,9 +36,9 @@ block-allow-list: # Use black-white-list if the DM version is earlie 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 diff --git a/dm/dm-table-routing.md b/dm/dm-table-routing.md index ce7e2576c49dd..6b6eb3811abb1 100644 --- a/dm/dm-table-routing.md +++ b/dm/dm-table-routing.md @@ -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 From 2ea235da7515d872235a69c925335327bafce731 Mon Sep 17 00:00:00 2001 From: xixirangrang <35301108+hfxsd@users.noreply.github.com> Date: Mon, 4 Sep 2023 12:01:22 +0800 Subject: [PATCH 2/3] refined examples --- dm/dm-binlog-event-filter.md | 2 +- dm/dm-block-allow-table-lists.md | 2 +- dm/dm-table-routing.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dm/dm-binlog-event-filter.md b/dm/dm-binlog-event-filter.md index 6671636ab9018..35cd66eeea0d8 100644 --- a/dm/dm-binlog-event-filter.md +++ b/dm/dm-binlog-event-filter.md @@ -25,7 +25,7 @@ Starting from DM v2.0.2, you can configure the binlog event filter in the source When you use the wildcard for matching schemas and tables, note the following: -- `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. +- `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. - `sql-pattern` only supports regular expressions. diff --git a/dm/dm-block-allow-table-lists.md b/dm/dm-block-allow-table-lists.md index 6288c01410af9..fdcf6b04ae207 100644 --- a/dm/dm-block-allow-table-lists.md +++ b/dm/dm-block-allow-table-lists.md @@ -36,7 +36,7 @@ block-allow-list: # Use black-white-list if the DM version is earlie In simple scenarios, it is recommended that you use the wildcard for matching schemas and tables. However, note the following version differences: -- 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. +- 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. - A regular expression must begin with the `~` character. diff --git a/dm/dm-table-routing.md b/dm/dm-table-routing.md index 6b6eb3811abb1..16668200a4446 100644 --- a/dm/dm-table-routing.md +++ b/dm/dm-table-routing.md @@ -40,7 +40,7 @@ routes: 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: -- 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. +- 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. - `table-regexp`, `schema-regexp`, and `source-regexp` only support regular expressions and cannot start with the `~` symbol. From 5505c5374d4bf3a98e2854a9971e06960661fd30 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 8 Sep 2023 09:46:51 +0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Ran --- dm/dm-binlog-event-filter.md | 2 +- dm/dm-block-allow-table-lists.md | 2 +- dm/dm-table-routing.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dm/dm-binlog-event-filter.md b/dm/dm-binlog-event-filter.md index 35cd66eeea0d8..5bcc5d35bc240 100644 --- a/dm/dm-binlog-event-filter.md +++ b/dm/dm-binlog-event-filter.md @@ -25,7 +25,7 @@ Starting from DM v2.0.2, you can configure the binlog event filter in the source When you use the wildcard for matching schemas and tables, note the following: -- `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. +- `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. - `sql-pattern` only supports regular expressions. diff --git a/dm/dm-block-allow-table-lists.md b/dm/dm-block-allow-table-lists.md index fdcf6b04ae207..3c131d245e2ca 100644 --- a/dm/dm-block-allow-table-lists.md +++ b/dm/dm-block-allow-table-lists.md @@ -36,7 +36,7 @@ block-allow-list: # Use black-white-list if the DM version is earlie In simple scenarios, it is recommended that you use the wildcard for matching schemas and tables. However, note the following version differences: -- 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. +- 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. - A regular expression must begin with the `~` character. diff --git a/dm/dm-table-routing.md b/dm/dm-table-routing.md index 16668200a4446..63f1089e56ef6 100644 --- a/dm/dm-table-routing.md +++ b/dm/dm-table-routing.md @@ -40,7 +40,7 @@ routes: 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: -- 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. +- 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. - `table-regexp`, `schema-regexp`, and `source-regexp` only support regular expressions and cannot start with the `~` symbol.