### What did you do?
1. create a `changefeed.toml`:
```
[filter]
rules = […'test.tt']
```
2. create a changefeed with the `changefeed.toml`:
`$ cdc cli changefeed create --sink-uri="blackhole://" --config changefeed.toml`
3. create table `tt` and insert a row in the upstream:
```
MySQL [test]> create table tt ( id int primary key );
Query OK, 0 rows affected (0.11 sec)
MySQL [test]> insert into tt value (1);
Query OK, 1 row affected (0.01 sec)
```
4. create table `tt_2` and insert some rows in the upstream:
```
MySQL [test]> create table tt_2 ( id int primary key );
Query OK, 0 rows affected (0.10 sec)
MySQL [test]> insert into tt_2 value (1);
Query OK, 1 row affected (0.02 sec)
MySQL [test]> insert into tt_2 value (2);
Query OK, 1 row affected (0.00 sec)
```
5. add a column for table `tt_2` :
```
MySQL [test]> alter table tt_2 add column a int ;
Query OK, 0 rows affected (0.26 sec)
```
6. drop table `tt`:
```
MySQL [test]> drop table tt;
Query OK, 0 rows affected (0.24 sec)
```
7. rename `tt_2` to `tt`:
```
MySQL [test]> rename table tt_2 to tt;
Query OK, 0 rows affected (0.09 sec)
```
8. insert some rows to the new `tt`:
```
MySQL [test]> insert into tt value (3,1);
Query OK, 1 row affected (0.01 sec)
MySQL [test]> insert into tt value (4,1);
Query OK, 1 row affected (0.01 sec)
```
### What did you expect to see?
TiCDC will capture all the changelogs from table `tt`, whether this table has been renamed or not.
### What did you see instead?
The program only captures table `tt` which have not been renamed.
the BlockHole log:
```
# grep BlockHoleSink cdc-*/ticdc.log | grep -v FlushRowChangedEvents | grep -v Checkpoint
cdc-2/ticdc.log:[2021/11/24 17:06:47.590 +08:00] [DEBUG] [black_hole.go:69] ["BlockHoleSink: DDL Event"] [ddl="{\"StartTs\":429324974450016261,\"CommitTs\":429324974450016264,\"TableInfo\":{\"Schema\":\"test\",\"Table\":\"tt\",\"TableID\":45,\"ColumnInfo\":[{\"Name\":\"id\",\"Type\":3}]},\"PreTableInfo\":null,\"Query\":\"create table tt ( id int primary key )\",\"Type\":3}"]
cdc-2/ticdc.log:[2021/11/24 17:06:58.527 +08:00] [DEBUG] [black_hole.go:41] ["BlockHoleSink: EmitRowChangedEvents"] [row="{\"start-ts\":429324977529946113,\"commit-ts\":429324977529946114,\"row-id\":1,\"table\":{\"db-name\":\"test\",\"tbl-name\":\"tt\",\"tbl-id\":45,\"is-partition\":false},\"table-info-version\":429324974450016264,\"replica-id\":0,\"columns\":[{\"name\":\"id\",\"type\":3,\"flag\":11,\"value\":1}],\"pre-columns\":null}"]
cdc-2/ticdc.log:[2021/11/24 17:09:08.735 +08:00] [DEBUG] [black_hole.go:69] ["BlockHoleSink: DDL Event"] [ddl="{\"StartTs\":429325011241664520,\"CommitTs\":429325011241664522,\"TableInfo\":{\"Schema\":\"test\",\"Table\":\"tt_2\",\"TableID\":47,\"ColumnInfo\":[{\"Name\":\"id\",\"Type\":3}]},\"PreTableInfo\":null,\"Query\":\"create table tt_2 ( id int primary key )\",\"Type\":3}"]
cdc-2/ticdc.log:[2021/11/24 17:10:03.820 +08:00] [DEBUG] [black_hole.go:69] ["BlockHoleSink: DDL Event"] [ddl="{\"StartTs\":429325025856192513,\"CommitTs\":429325025856192515,\"TableInfo\":{\"Schema\":\"test\",\"Table\":\"tt_2\",\"TableID\":47,\"ColumnInfo\":[{\"Name\":\"id\",\"Type\":3},{\"Name\":\"a\",\"Type\":3}]},\"PreTableInfo\":{\"Schema\":\"test\",\"Table\":\"tt_2\",\"TableID\":47,\"ColumnInfo\":[{\"Name\":\"id\",\"Type\":3}]},\"Query\":\"alter table tt_2 add column a int\",\"Type\":5}"]
cdc-2/ticdc.log:[2021/11/24 17:10:14.836 +08:00] [DEBUG] [black_hole.go:69] ["BlockHoleSink: DDL Event"] [ddl="{\"StartTs\":429325028687609857,\"CommitTs\":429325028687609859,\"TableInfo\":{\"Schema\":\"test\",\"Table\":\"tt\",\"TableID\":45,\"ColumnInfo\":[{\"Name\":\"id\",\"Type\":3}]},\"PreTableInfo\":{\"Schema\":\"test\",\"Table\":\"tt\",\"TableID\":45,\"ColumnInfo\":[{\"Name\":\"id\",\"Type\":3}]},\"Query\":\"drop table tt\",\"Type\":4}"]
cdc-2/ticdc.log:[2021/11/24 17:10:24.592 +08:00] [DEBUG] [black_hole.go:69] ["BlockHoleSink: DDL Event"] [ddl="{\"StartTs\":429325031479181318,\"CommitTs\":429325031479181319,\"TableInfo\":{\"Schema\":\"test\",\"Table\":\"tt\",\"TableID\":47,\"ColumnInfo\":[{\"Name\":\"id\",\"Type\":3},{\"Name\":\"a\",\"Type\":3}]},\"PreTableInfo\":{\"Schema\":\"test\",\"Table\":\"tt_2\",\"TableID\":47,\"ColumnInfo\":[{\"Name\":\"id\",\"Type\":3},{\"Name\":\"a\",\"Type\":3}]},\"Query\":\"rename table tt_2 to tt\",\"Type\":14}"]
```
and there is another question:
why the DDLs from `tt_2` are inputted to the BlackHole sink? they should be filtered.
### Versions of the cluster
Upstream TiDB cluster version (execute `SELECT tidb_version();` in a MySQL client):
```console
v4.0.14
```
TiCDC version (execute `cdc version`):
```console
v4.0.14
```