Repository: pingcap/tiflow
Pull request #11605 (2024-09-19 16:32:30)

*: upgrade tidb dependency to latest master
<!--
Thank you for contributing to TiFlow! 
Please read MD's [CONTRIBUTING](https://github.com/pingcap/tiflow/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.
-->

### What problem does this PR solve?
<!--
Please create an issue first to describe the problem.

There MUST be one line starting with "Issue Number:  " and 
linking the relevant issues via the "close" or "ref".

For more info, check https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/contribute-code.html#referring-to-an-issue.
 -->

Issue Number: close #xxx

### What is changed and how it works?


### Check List <!--REMOVE the items that are not applicable-->

#### Tests <!-- At least one of them must be included. -->

 - Unit test
 - Integration test
 - Manual test (add detailed scripts or steps below)
 - No code

#### Questions <!-- Authors should answer these questions and reviewers should consider these questions. -->

##### Will it cause performance regression or break compatibility?

##### Do you need to update user documentation, design documentation or monitoring documentation?

### Release note <!-- bugfixes or new features need a release note -->

```release-note
Please refer to [Release Notes Language Style Guide](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.

If you don't think this PR needs a release note then fill it with `None`.
```


ti-chi-bot[bot]: 
[FORMAT CHECKER NOTIFICATION]

**Notice**: To remove the `do-not-merge/needs-linked-issue` label, please provide the linked issue number on one line in the PR body, for example: `Issue Number: close #123` or `Issue Number: ref #456`.

<sub>:open_book: For more info, you can check the ["Contribute Code"](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/contribute-code.html#referring-to-an-issue) section in the development guide.</sub>


<!--Checker Notification Identifier-->

ti-chi-bot[bot]: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
**Once this PR has been reviewed and has the lgtm label**, please ask for approval from [d3hunter](https://github.com/d3hunter), **ensuring that each of them provides their approval before proceeding**. For more information see [the Code Review Process](https://book.prow.tidb.net/#/workflows/pr).

The full list of commands accepted by this bot can be found [here](https://prow.tidb.net/command-help?repo=pingcap%2Ftiflow).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/pingcap/tiflow/blob/master/OWNERS)**
- **[dm/OWNERS](https://github.com/pingcap/tiflow/blob/master/dm/OWNERS)**
- **[engine/OWNERS](https://github.com/pingcap/tiflow/blob/master/engine/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["d3hunter"]} -->
ti-chi-bot[bot]: @D3Hunter: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
jenkins-ticdc/verify | f2582d24ef9d85106ec7f80fc0db0bb28e2244b1 | [link](https://do.pingcap.net/jenkins/job/pingcap/job/tiflow/job/ghpr_verify/2617/display/redirect) | true | `/test verify`

[Full PR test history](https://prow.tidb.net/pr-history?org=pingcap&repo=tiflow&pr=11605). [Your PR dashboard](https://prow.tidb.net/pr?query=is%3Apr%20state%3Aopen%20author%3AD3Hunter).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
ti-chi-bot[bot]: @D3Hunter: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
jenkins-ticdc/verify | f2582d24ef9d85106ec7f80fc0db0bb28e2244b1 | [link](https://do.pingcap.net/jenkins/job/pingcap/job/tiflow/job/ghpr_verify/2617/display/redirect) | true | `/test verify`
pull-cdc-integration-mysql-test | f2582d24ef9d85106ec7f80fc0db0bb28e2244b1 | [link](https://do.pingcap.net/jenkins/job/pingcap/job/tiflow/job/pull_cdc_integration_test/2706/display/redirect) | true | `/test cdc-integration-mysql-test`
pull-dm-integration-test | f2582d24ef9d85106ec7f80fc0db0bb28e2244b1 | [link](https://do.pingcap.net/jenkins/job/pingcap/job/tiflow/job/pull_dm_integration_test/2865/display/redirect) | true | `/test dm-integration-test`

[Full PR test history](https://prow.tidb.net/pr-history?org=pingcap&repo=tiflow&pr=11605). [Your PR dashboard](https://prow.tidb.net/pr?query=is%3Apr%20state%3Aopen%20author%3AD3Hunter).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
ti-chi-bot[bot]: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
**Once this PR has been reviewed and has the lgtm label**, please ask for approval from [d3hunter](https://github.com/d3hunter), **ensuring that each of them provides their approval before proceeding**. For more information see [the Code Review Process](https://book.prow.tidb.net/#/workflows/pr).

The full list of commands accepted by this bot can be found [here](https://prow.tidb.net/command-help?repo=pingcap%2Ftiflow).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/pingcap/tidb/blob/master/OWNERS)**
- **[dm/OWNERS](https://github.com/pingcap/tidb/blob/master/dm/OWNERS)**
- **[engine/OWNERS](https://github.com/pingcap/tidb/blob/master/engine/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["d3hunter"]} -->
ti-chi-bot[bot]: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/pingcap/tiflow/pull/11605#pullrequestreview-2317353490" title="Approved">hongyunyan</a>*
**Once this PR has been reviewed and has the lgtm label**, please ask for approval from [d3hunter](https://github.com/d3hunter), **ensuring that each of them provides their approval before proceeding**. For more information see [the Code Review Process](https://book.prow.tidb.net/#/workflows/pr).

The full list of commands accepted by this bot can be found [here](https://prow.tidb.net/command-help?repo=pingcap%2Ftiflow).

<details open>
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/pingcap/tiflow/blob/master/OWNERS)~~ [hongyunyan]
- **[dm/OWNERS](https://github.com/pingcap/tiflow/blob/master/dm/OWNERS)**
- **[engine/OWNERS](https://github.com/pingcap/tiflow/blob/master/engine/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["d3hunter"]} -->
ti-chi-bot[bot]: [LGTM Timeline notifier]
---
Timeline:

- `2024-09-20 06:12:15.465135067 +0000 UTC m=+1200805.205558999`: :ballot_box_with_check: agreed by [hongyunyan](https://github.com/hongyunyan).
ti-chi-bot[bot]: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/pingcap/tiflow/pull/11605#pullrequestreview-2317354989" title="Approved">GMHDBJD</a>*, *<a href="https://github.com/pingcap/tiflow/pull/11605#pullrequestreview-2317353490" title="Approved">hongyunyan</a>*

The full list of commands accepted by this bot can be found [here](https://prow.tidb.net/command-help?repo=pingcap%2Ftiflow).

The pull request process is described [here](https://book.prow.tidb.net/#/workflows/pr)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/pingcap/tiflow/blob/master/OWNERS)~~ [GMHDBJD,hongyunyan]
- ~~[dm/OWNERS](https://github.com/pingcap/tiflow/blob/master/dm/OWNERS)~~ [GMHDBJD]
- ~~[engine/OWNERS](https://github.com/pingcap/tiflow/blob/master/engine/OWNERS)~~ [GMHDBJD]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
ti-chi-bot[bot]: [LGTM Timeline notifier]
---
Timeline:

- `2024-09-20 06:12:15.465135067 +0000 UTC m=+1200805.205558999`: :ballot_box_with_check: agreed by [hongyunyan](https://github.com/hongyunyan).
- `2024-09-20 06:13:34.465498402 +0000 UTC m=+1200884.205922342`: :ballot_box_with_check: agreed by [GMHDBJD](https://github.com/GMHDBJD).
ti-chi-bot[bot]: @D3Hunter: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-cdc-integration-mysql-test | f2582d24ef9d85106ec7f80fc0db0bb28e2244b1 | [link](https://do.pingcap.net/jenkins/job/pingcap/job/tiflow/job/pull_cdc_integration_test/2706/display/redirect) | true | `/test cdc-integration-mysql-test`
pull-dm-integration-test | f2582d24ef9d85106ec7f80fc0db0bb28e2244b1 | [link](https://do.pingcap.net/jenkins/job/pingcap/job/tiflow/job/pull_dm_integration_test/2865/display/redirect) | true | `/test dm-integration-test`
jenkins-ticdc/verify | 57bcdcb41280ac66e5bb213c1ac12007cc3d791b | [link](https://do.pingcap.net/jenkins/job/pingcap/job/tiflow/job/ghpr_verify/2620/display/redirect) | true | `/test verify`

[Full PR test history](https://prow.tidb.net/pr-history?org=pingcap&repo=tiflow&pr=11605). [Your PR dashboard](https://prow.tidb.net/pr?query=is%3Apr%20state%3Aopen%20author%3AD3Hunter).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
D3Hunter: /retest
ti-chi-bot[bot]: @D3Hunter: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
jenkins-ticdc/verify | a22a3efb79db034b87bbfbf0cab3edfca4b99e1e | [link](https://do.pingcap.net/jenkins/job/pingcap/job/tiflow/job/ghpr_verify/2627/display/redirect) | true | `/test verify`

[Full PR test history](https://prow.tidb.net/pr-history?org=pingcap&repo=tiflow&pr=11605). [Your PR dashboard](https://prow.tidb.net/pr?query=is%3Apr%20state%3Aopen%20author%3AD3Hunter).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
ti-chi-bot[bot]: @D3Hunter: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
jenkins-ticdc/verify | a22a3efb79db034b87bbfbf0cab3edfca4b99e1e | [link](https://do.pingcap.net/jenkins/job/pingcap/job/tiflow/job/ghpr_verify/2627/display/redirect) | true | `/test verify`
pull-dm-integration-test | 29bbc155784ede7d039713bcf3b08b199c213b72 | [link](https://do.pingcap.net/jenkins/job/pingcap/job/tiflow/job/pull_dm_integration_test/2874/display/redirect) | true | `/test dm-integration-test`

[Full PR test history](https://prow.tidb.net/pr-history?org=pingcap&repo=tiflow&pr=11605). [Your PR dashboard](https://prow.tidb.net/pr?query=is%3Apr%20state%3Aopen%20author%3AD3Hunter).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/pingcap/tiflow/pull/11605?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) Report
Attention: Patch coverage is `83.58209%` with `11 lines` in your changes missing coverage. Please review.
> Project coverage is 57.4645%. Comparing base [(`45c831a`)](https://app.codecov.io/gh/pingcap/tiflow/commit/45c831ae03b066caf7b23d1542cdb57e6c28028e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) to head [(`29bbc15`)](https://app.codecov.io/gh/pingcap/tiflow/commit/29bbc155784ede7d039713bcf3b08b199c213b72?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap).

<details><summary>Additional details and impacted files</summary>


| [Components](https://app.codecov.io/gh/pingcap/tiflow/pull/11605/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | |
|---|---|---|
| [cdc](https://app.codecov.io/gh/pingcap/tiflow/pull/11605/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `61.2226% <75.0000%> (-0.0096%)` | :arrow_down: |
| [dm](https://app.codecov.io/gh/pingcap/tiflow/pull/11605/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `51.0253% <88.3720%> (-0.0081%)` | :arrow_down: |
| [engine](https://app.codecov.io/gh/pingcap/tiflow/pull/11605/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `63.3526% <ø> (-0.0424%)` | :arrow_down: |

| [Flag](https://app.codecov.io/gh/pingcap/tiflow/pull/11605/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | |
|---|---|---|
| [unit](https://app.codecov.io/gh/pingcap/tiflow/pull/11605/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `57.4645% <83.5820%> (-0.0127%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap#carryforward-flags-in-the-pull-request-comment) to find out more.

```diff
@@               Coverage Diff                @@
##             master     #11605        +/-   ##
================================================
- Coverage   57.4771%   57.4645%   -0.0127%     
================================================
  Files           851        851                
  Lines        126539     126539                
================================================
- Hits          72731      72715        -16     
- Misses        48407      48420        +13     
- Partials       5401       5404         +3     
```

</details>
D3Hunter: /retest

Patch:
diff --git a/cdc/entry/mounter.go b/cdc/entry/mounter.go
index 0e511e47a..3d1fe7ac6 100644
--- a/cdc/entry/mounter.go
+++ b/cdc/entry/mounter.go
@@ -28,7 +28,7 @@ import (
 	"github.com/pingcap/errors"
 	"github.com/pingcap/log"
 	"github.com/pingcap/tidb/pkg/kv"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/table"
 	"github.com/pingcap/tidb/pkg/tablecodec"
diff --git a/cdc/entry/schema/snapshot.go b/cdc/entry/schema/snapshot.go
index 80755552e..6703dc724 100644
--- a/cdc/entry/schema/snapshot.go
+++ b/cdc/entry/schema/snapshot.go
@@ -25,7 +25,8 @@ import (
 	"github.com/pingcap/errors"
 	"github.com/pingcap/log"
 	timeta "github.com/pingcap/tidb/pkg/meta"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	cerror "github.com/pingcap/tiflow/pkg/errors"
 	"github.com/pingcap/tiflow/pkg/filter"
@@ -1085,7 +1086,7 @@ func (s *snapshot) alterPartitioning(job *timodel.Job) error {
 
 func (s *snapshot) renameTables(job *timodel.Job, currentTs uint64) error {
 	var oldSchemaIDs, newSchemaIDs, oldTableIDs []int64
-	var newTableNames, oldSchemaNames []*timodel.CIStr
+	var newTableNames, oldSchemaNames []*pmodel.CIStr
 	err := job.DecodeArgs(&oldSchemaIDs, &newSchemaIDs, &newTableNames, &oldTableIDs, &oldSchemaNames)
 	if err != nil {
 		return errors.Trace(err)
diff --git a/cdc/entry/schema_storage.go b/cdc/entry/schema_storage.go
index faaa6d4fe..fc1d33f21 100644
--- a/cdc/entry/schema_storage.go
+++ b/cdc/entry/schema_storage.go
@@ -24,7 +24,8 @@ import (
 	"github.com/pingcap/errors"
 	"github.com/pingcap/log"
 	tidbkv "github.com/pingcap/tidb/pkg/kv"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tiflow/cdc/entry/schema"
 	"github.com/pingcap/tiflow/cdc/kv"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -478,7 +479,7 @@ func (s *schemaStorage) buildRenameEvents(
 ) ([]*model.DDLEvent, error) {
 	var (
 		oldSchemaIDs, newSchemaIDs, oldTableIDs []int64
-		newTableNames, oldSchemaNames           []*timodel.CIStr
+		newTableNames, oldSchemaNames           []*pmodel.CIStr
 		ddlEvents                               []*model.DDLEvent
 	)
 	err := job.DecodeArgs(&oldSchemaIDs, &newSchemaIDs,
diff --git a/cdc/model/codec/codec.go b/cdc/model/codec/codec.go
index 7aeb5bad5..c10927cf1 100644
--- a/cdc/model/codec/codec.go
+++ b/cdc/model/codec/codec.go
@@ -16,7 +16,7 @@ package codec
 import (
 	"encoding/binary"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	codecv1 "github.com/pingcap/tiflow/cdc/model/codec/v1"
 	"github.com/tinylib/msgp/msgp"
diff --git a/cdc/model/codec/v1/codec.go b/cdc/model/codec/v1/codec.go
index 8c94c9b9b..22bb5d58b 100644
--- a/cdc/model/codec/v1/codec.go
+++ b/cdc/model/codec/v1/codec.go
@@ -14,7 +14,7 @@
 package v1
 
 import (
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/util/rowcodec"
 	"github.com/pingcap/tiflow/cdc/model"
 )
diff --git a/cdc/model/codec/v1/convert.go b/cdc/model/codec/v1/convert.go
index 7a004a86a..3cde1007a 100644
--- a/cdc/model/codec/v1/convert.go
+++ b/cdc/model/codec/v1/convert.go
@@ -16,7 +16,7 @@ package v1
 import (
 	"bytes"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 )
 
diff --git a/cdc/model/owner.go b/cdc/model/owner.go
index 3253c5faf..4dd579ba8 100644
--- a/cdc/model/owner.go
+++ b/cdc/model/owner.go
@@ -18,7 +18,7 @@ import (
 	"fmt"
 
 	"github.com/pingcap/errors"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/processor/tablepb"
 	cerror "github.com/pingcap/tiflow/pkg/errors"
 )
diff --git a/cdc/model/schema_storage.go b/cdc/model/schema_storage.go
index beafc800b..b7ad2d5db 100644
--- a/cdc/model/schema_storage.go
+++ b/cdc/model/schema_storage.go
@@ -17,7 +17,7 @@ import (
 	"fmt"
 
 	"github.com/pingcap/log"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tidb/pkg/table/tables"
diff --git a/cdc/model/sink.go b/cdc/model/sink.go
index d4b687612..cab078011 100644
--- a/cdc/model/sink.go
+++ b/cdc/model/sink.go
@@ -23,7 +23,8 @@ import (
 
 	"github.com/pingcap/log"
 	"github.com/pingcap/tidb/pkg/kv"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/util/rowcodec"
 	"github.com/pingcap/tiflow/pkg/errors"
@@ -813,7 +814,7 @@ func BuildTiDBTableInfoImpl(
 	columnIDAllocator ColumnIDAllocator,
 ) *model.TableInfo {
 	ret := &model.TableInfo{}
-	ret.Name = model.NewCIStr(tableName)
+	ret.Name = pmodel.NewCIStr(tableName)
 
 	hasPrimaryKeyColumn := false
 	for i, col := range columns {
@@ -824,7 +825,7 @@ func BuildTiDBTableInfoImpl(
 		if col == nil {
 			// actually, col should never be nil according to `datum2Column` and `WrapTableInfo` in prod env
 			// we mock it as generated column just for test
-			columnInfo.Name = model.NewCIStr("omitted")
+			columnInfo.Name = pmodel.NewCIStr("omitted")
 			columnInfo.GeneratedExprString = "pass_generated_check"
 			columnInfo.GeneratedStored = false
 			ret.Columns = append(ret.Columns, columnInfo)
@@ -832,7 +833,7 @@ func BuildTiDBTableInfoImpl(
 		}
 		// add a mock id to identify columns inside cdc
 		columnInfo.ID = columnIDAllocator.GetColumnID(col.Name)
-		columnInfo.Name = model.NewCIStr(col.Name)
+		columnInfo.Name = pmodel.NewCIStr(col.Name)
 		columnInfo.SetType(col.Type)
 
 		if col.Collation != "" {
@@ -903,7 +904,7 @@ func BuildTiDBTableInfoImpl(
 	nextMockIndexID := minIndexID + 1
 	for i, colOffsets := range indexColumns {
 		indexInfo := &model.IndexInfo{
-			Name:  model.NewCIStr(fmt.Sprintf("idx_%d", i)),
+			Name:  pmodel.NewCIStr(fmt.Sprintf("idx_%d", i)),
 			State: model.StatePublic,
 		}
 		firstCol := columns[colOffsets[0]]
diff --git a/cdc/owner/ddl_manager.go b/cdc/owner/ddl_manager.go
index 853b5cee8..e709d0862 100644
--- a/cdc/owner/ddl_manager.go
+++ b/cdc/owner/ddl_manager.go
@@ -23,8 +23,8 @@ import (
 	"github.com/pingcap/errors"
 	"github.com/pingcap/failpoint"
 	"github.com/pingcap/log"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tiflow/cdc/entry"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/cdc/puller"
diff --git a/cdc/puller/ddl_puller.go b/cdc/puller/ddl_puller.go
index aa4cd3559..1ff6356fb 100644
--- a/cdc/puller/ddl_puller.go
+++ b/cdc/puller/ddl_puller.go
@@ -25,7 +25,8 @@ import (
 	"github.com/pingcap/errors"
 	"github.com/pingcap/log"
 	tidbkv "github.com/pingcap/tidb/pkg/kv"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tiflow/cdc/entry"
 	"github.com/pingcap/tiflow/cdc/entry/schema"
@@ -532,7 +533,7 @@ func (p *ddlJobPullerImpl) checkIneligibleTableDDL(snapBefore *schema.Snapshot,
 func (p *ddlJobPullerImpl) handleRenameTables(job *timodel.Job) (skip bool, err error) {
 	var (
 		oldSchemaIDs, newSchemaIDs, oldTableIDs []int64
-		newTableNames, oldSchemaNames           []*timodel.CIStr
+		newTableNames, oldSchemaNames           []*pmodel.CIStr
 	)
 
 	err = job.DecodeArgs(&oldSchemaIDs, &newSchemaIDs,
@@ -543,7 +544,7 @@ func (p *ddlJobPullerImpl) handleRenameTables(job *timodel.Job) (skip bool, err
 
 	var (
 		remainOldSchemaIDs, remainNewSchemaIDs, remainOldTableIDs []int64
-		remainNewTableNames, remainOldSchemaNames                 []*timodel.CIStr
+		remainNewTableNames, remainOldSchemaNames                 []*pmodel.CIStr
 	)
 
 	multiTableInfos := job.BinlogInfo.MultipleTableInfos
diff --git a/cdc/sink/ddlsink/cloudstorage/cloud_storage_ddl_sink.go b/cdc/sink/ddlsink/cloudstorage/cloud_storage_ddl_sink.go
index 5e158e390..9c037544f 100644
--- a/cdc/sink/ddlsink/cloudstorage/cloud_storage_ddl_sink.go
+++ b/cdc/sink/ddlsink/cloudstorage/cloud_storage_ddl_sink.go
@@ -22,7 +22,7 @@ import (
 
 	"github.com/pingcap/log"
 	"github.com/pingcap/tidb/br/pkg/storage"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/cdc/sink/ddlsink"
 	"github.com/pingcap/tiflow/cdc/sink/metrics"
diff --git a/cdc/sink/ddlsink/mysql/async_ddl.go b/cdc/sink/ddlsink/mysql/async_ddl.go
index 8e480bb06..5f8a1666c 100644
--- a/cdc/sink/ddlsink/mysql/async_ddl.go
+++ b/cdc/sink/ddlsink/mysql/async_ddl.go
@@ -20,7 +20,7 @@ import (
 
 	"github.com/pingcap/log"
 	"github.com/pingcap/tidb/dumpling/export"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	"go.uber.org/zap"
 )
@@ -34,7 +34,7 @@ const timeout = 5 * time.Second
 // FROM information_schema.ddl_jobs
 var checkRunningAddIndexSQL = `
 ADMIN SHOW DDL JOBS 1
-WHERE DB_NAME = "%s" 
+WHERE DB_NAME = "%s"
     AND TABLE_NAME = "%s"
     AND JOB_TYPE LIKE "add index%%"
     AND (STATE = "running" OR STATE = "queueing");
diff --git a/cdc/sink/ddlsink/mysql/mysql_ddl_sink.go b/cdc/sink/ddlsink/mysql/mysql_ddl_sink.go
index ff5942b43..f65c1c6aa 100644
--- a/cdc/sink/ddlsink/mysql/mysql_ddl_sink.go
+++ b/cdc/sink/ddlsink/mysql/mysql_ddl_sink.go
@@ -23,7 +23,7 @@ import (
 	lru "github.com/hashicorp/golang-lru"
 	"github.com/pingcap/failpoint"
 	"github.com/pingcap/log"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/cdc/sink/ddlsink"
 	"github.com/pingcap/tiflow/cdc/sink/metrics"
diff --git a/cmd/filter-helper/main.go b/cmd/filter-helper/main.go
index bb722fc70..97a0e671c 100644
--- a/cmd/filter-helper/main.go
+++ b/cmd/filter-helper/main.go
@@ -17,7 +17,7 @@ import (
 	"fmt"
 	"strings"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/pkg/cmd/util"
 	"github.com/pingcap/tiflow/pkg/config"
diff --git a/dm/pkg/conn/mockdb.go b/dm/pkg/conn/mockdb.go
index f9d943071..171543870 100644
--- a/dm/pkg/conn/mockdb.go
+++ b/dm/pkg/conn/mockdb.go
@@ -147,7 +147,7 @@ func NewCluster() (*Cluster, error) {
 	}
 	cluster.Storage = storage
 
-	session.SetSchemaLease(0)
+	session.SetSchemaLease(time.Second)
 	session.DisableStats4Test()
 	dom, err := session.BootstrapSession(storage)
 	if err != nil {
diff --git a/dm/pkg/parser/common.go b/dm/pkg/parser/common.go
index 693e4645e..31e35ad05 100644
--- a/dm/pkg/parser/common.go
+++ b/dm/pkg/parser/common.go
@@ -19,7 +19,7 @@ import (
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
 	"github.com/pingcap/tidb/pkg/parser/format"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	_ "github.com/pingcap/tidb/pkg/types/parser_driver" // for import parser driver
 	"github.com/pingcap/tidb/pkg/util/filter"
 	"github.com/pingcap/tiflow/dm/pkg/conn"
@@ -128,8 +128,8 @@ func (v *tableRenameVisitor) Enter(in ast.Node) (ast.Node, bool) {
 			v.hasErr = true
 			return in, true
 		}
-		t.Schema = model.NewCIStr(v.targetNames[v.i].Schema)
-		t.Name = model.NewCIStr(v.targetNames[v.i].Name)
+		t.Schema = pmodel.NewCIStr(v.targetNames[v.i].Schema)
+		t.Name = pmodel.NewCIStr(v.targetNames[v.i].Name)
 		v.i++
 		return in, true
 	}
@@ -155,11 +155,11 @@ func RenameDDLTable(stmt ast.StmtNode, targetTables []*filter.Table) (string, er
 
 	switch v := stmt.(type) {
 	case *ast.AlterDatabaseStmt:
-		v.Name = model.NewCIStr(targetTables[0].Schema)
+		v.Name = pmodel.NewCIStr(targetTables[0].Schema)
 	case *ast.CreateDatabaseStmt:
-		v.Name = model.NewCIStr(targetTables[0].Schema)
+		v.Name = pmodel.NewCIStr(targetTables[0].Schema)
 	case *ast.DropDatabaseStmt:
-		v.Name = model.NewCIStr(targetTables[0].Schema)
+		v.Name = pmodel.NewCIStr(targetTables[0].Schema)
 	default:
 		visitor := &tableRenameVisitor{
 			targetNames: targetTables,
@@ -188,7 +188,7 @@ func RenameDDLTable(stmt ast.StmtNode, targetTables []*filter.Table) (string, er
 // if fail to restore, it would not restore the value of `stmt` (it changes it's values if `stmt` is one of  DropTableStmt, RenameTableStmt, AlterTableStmt).
 func SplitDDL(stmt ast.StmtNode, schema string) (sqls []string, err error) {
 	var (
-		schemaName = model.NewCIStr(schema) // fill schema name
+		schemaName = pmodel.NewCIStr(schema) // fill schema name
 		bf         = new(bytes.Buffer)
 		ctx        = &format.RestoreCtx{
 			Flags: format.DefaultRestoreFlags | format.RestoreTiDBSpecialComment | format.RestoreStringWithoutDefaultCharset,
diff --git a/dm/pkg/schema/tracker.go b/dm/pkg/schema/tracker.go
index 78b08364e..db150314c 100644
--- a/dm/pkg/schema/tracker.go
+++ b/dm/pkg/schema/tracker.go
@@ -28,10 +28,12 @@ import (
 	"github.com/pingcap/tidb/pkg/infoschema"
 	"github.com/pingcap/tidb/pkg/kv"
 	"github.com/pingcap/tidb/pkg/meta/autoid"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
+	"github.com/pingcap/tidb/pkg/planner/core/resolve"
 	"github.com/pingcap/tidb/pkg/sessionctx"
 	"github.com/pingcap/tidb/pkg/sessionctx/variable"
 	"github.com/pingcap/tidb/pkg/util/chunk"
@@ -99,11 +101,11 @@ func (se executorContext) ParseWithParams(context.Context, string, ...interface{
 	return nil, nil
 }
 
-func (se executorContext) ExecRestrictedStmt(context.Context, ast.StmtNode, ...sqlexec.OptionFuncAlias) ([]chunk.Row, []*ast.ResultField, error) {
+func (se executorContext) ExecRestrictedStmt(context.Context, ast.StmtNode, ...sqlexec.OptionFuncAlias) ([]chunk.Row, []*resolve.ResultField, error) {
 	return nil, nil, nil
 }
 
-func (se executorContext) ExecRestrictedSQL(context.Context, []sqlexec.OptionFuncAlias, string, ...interface{}) ([]chunk.Row, []*ast.ResultField, error) {
+func (se executorContext) ExecRestrictedSQL(context.Context, []sqlexec.OptionFuncAlias, string, ...interface{}) ([]chunk.Row, []*resolve.ResultField, error) {
 	return nil, nil, nil
 }
 
@@ -227,12 +229,12 @@ func (tr *Tracker) GetTableInfo(table *filter.Table) (*model.TableInfo, error) {
 	if tr.closed.Load() {
 		return nil, dmterror.ErrSchemaTrackerIsClosed.New("fail to get table info")
 	}
-	return tr.upstreamTracker.TableByName(context.Background(), model.NewCIStr(table.Schema), model.NewCIStr(table.Name))
+	return tr.upstreamTracker.TableByName(context.Background(), pmodel.NewCIStr(table.Schema), pmodel.NewCIStr(table.Name))
 }
 
 // GetCreateTable returns the `CREATE TABLE` statement of the table.
 func (tr *Tracker) GetCreateTable(ctx context.Context, table *filter.Table) (string, error) {
-	tableInfo, err := tr.upstreamTracker.TableByName(ctx, model.NewCIStr(table.Schema), model.NewCIStr(table.Name))
+	tableInfo, err := tr.upstreamTracker.TableByName(ctx, pmodel.NewCIStr(table.Schema), pmodel.NewCIStr(table.Name))
 	if err != nil {
 		return "", err
 	}
@@ -251,7 +253,7 @@ func (tr *Tracker) AllSchemas() []string {
 
 // ListSchemaTables lists all tables in the schema.
 func (tr *Tracker) ListSchemaTables(schema string) ([]string, error) {
-	ret, err := tr.upstreamTracker.AllTableNamesOfSchema(model.NewCIStr(schema))
+	ret, err := tr.upstreamTracker.AllTableNamesOfSchema(pmodel.NewCIStr(schema))
 	if err != nil {
 		return nil, dmterror.ErrSchemaTrackerUnSchemaNotExist.Generate(schema)
 	}
@@ -263,7 +265,7 @@ func (tr *Tracker) ListSchemaTables(schema string) ([]string, error) {
 // TODO: move out of this package!
 func (tr *Tracker) GetSingleColumnIndices(db, tbl, col string) ([]*model.IndexInfo, error) {
 	col = strings.ToLower(col)
-	t, err := tr.upstreamTracker.TableByName(context.Background(), model.NewCIStr(db), model.NewCIStr(tbl))
+	t, err := tr.upstreamTracker.TableByName(context.Background(), pmodel.NewCIStr(db), pmodel.NewCIStr(tbl))
 	if err != nil {
 		return nil, err
 	}
@@ -310,12 +312,12 @@ func (tr *Tracker) Close() {
 
 // DropTable drops a table from this tracker.
 func (tr *Tracker) DropTable(table *filter.Table) error {
-	return tr.upstreamTracker.DeleteTable(model.NewCIStr(table.Schema), model.NewCIStr(table.Name))
+	return tr.upstreamTracker.DeleteTable(pmodel.NewCIStr(table.Schema), pmodel.NewCIStr(table.Name))
 }
 
 // CreateSchemaIfNotExists creates a SCHEMA of the given name if it did not exist.
 func (tr *Tracker) CreateSchemaIfNotExists(db string) error {
-	dbName := model.NewCIStr(db)
+	dbName := pmodel.NewCIStr(db)
 	if tr.upstreamTracker.SchemaByName(dbName) != nil {
 		return nil
 	}
@@ -341,15 +343,15 @@ func cloneTableInfo(ti *model.TableInfo) *model.TableInfo {
 
 // CreateTableIfNotExists creates a TABLE of the given name if it did not exist.
 func (tr *Tracker) CreateTableIfNotExists(table *filter.Table, ti *model.TableInfo) error {
-	schemaName := model.NewCIStr(table.Schema)
-	tableName := model.NewCIStr(table.Name)
+	schemaName := pmodel.NewCIStr(table.Schema)
+	tableName := pmodel.NewCIStr(table.Name)
 	ti = cloneTableInfo(ti)
 	ti.Name = tableName
 	return tr.upstreamTracker.CreateTableWithInfo(tr.se, schemaName, ti, nil, ddl.WithOnExist(ddl.OnExistIgnore))
 }
 
 // SplitBatchCreateTableAndHandle will split the batch if it exceeds the kv entry size limit.
-func (tr *Tracker) SplitBatchCreateTableAndHandle(schema model.CIStr, info []*model.TableInfo, l int, r int) error {
+func (tr *Tracker) SplitBatchCreateTableAndHandle(schema pmodel.CIStr, info []*model.TableInfo, l int, r int) error {
 	var err error
 	if err = tr.upstreamTracker.BatchCreateTableWithInfo(
 		tr.se, schema, info[l:r], ddl.WithOnExist(ddl.OnExistIgnore),
@@ -380,11 +382,11 @@ func (tr *Tracker) BatchCreateTableIfNotExist(tablesToCreate map[string]map[stri
 
 		var cloneTis []*model.TableInfo
 		for table, ti := range tableNameInfo {
-			cloneTi := cloneTableInfo(ti)        // clone TableInfo w.r.t the warning of the CreateTable function
-			cloneTi.Name = model.NewCIStr(table) // TableInfo has no `TableName`
+			cloneTi := cloneTableInfo(ti)         // clone TableInfo w.r.t the warning of the CreateTable function
+			cloneTi.Name = pmodel.NewCIStr(table) // TableInfo has no `TableName`
 			cloneTis = append(cloneTis, cloneTi)
 		}
-		schemaName := model.NewCIStr(schema)
+		schemaName := pmodel.NewCIStr(schema)
 		if err := tr.SplitBatchCreateTableAndHandle(schemaName, cloneTis, 0, len(cloneTis)); err != nil {
 			return err
 		}
diff --git a/dm/pkg/schema/visitor.go b/dm/pkg/schema/visitor.go
index 106a0877e..437d4b236 100644
--- a/dm/pkg/schema/visitor.go
+++ b/dm/pkg/schema/visitor.go
@@ -15,7 +15,7 @@ package schema
 
 import (
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 )
 
 type currentDBSetter struct {
@@ -36,7 +36,7 @@ func (c currentDBSetter) Enter(n ast.Node) (node ast.Node, skipChildren bool) {
 			if spec.Tp == ast.AlterTableAddConstraint && spec.Constraint.Refer != nil {
 				table := spec.Constraint.Refer.Table
 				if table.Schema.L == "" && v.Table.Schema.L != "" {
-					table.Schema = model.NewCIStr(v.Table.Schema.L)
+					table.Schema = pmodel.NewCIStr(v.Table.Schema.L)
 				}
 			}
 		}
@@ -50,7 +50,7 @@ func (c currentDBSetter) Leave(n ast.Node) (node ast.Node, ok bool) {
 		return n, true
 	}
 	if v.Schema.O == "" {
-		v.Schema = model.NewCIStr(c.currentDB)
+		v.Schema = pmodel.NewCIStr(c.currentDB)
 	}
 	return n, true
 }
diff --git a/dm/pkg/shardddl/optimism/info.go b/dm/pkg/shardddl/optimism/info.go
index 815ece7d8..6a445bfbb 100644
--- a/dm/pkg/shardddl/optimism/info.go
+++ b/dm/pkg/shardddl/optimism/info.go
@@ -18,7 +18,7 @@ import (
 	"encoding/json"
 	"fmt"
 
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/util/schemacmp"
 	"github.com/pingcap/tiflow/dm/common"
 	"github.com/pingcap/tiflow/dm/pkg/etcdutil"
diff --git a/dm/pkg/shardddl/optimism/lock.go b/dm/pkg/shardddl/optimism/lock.go
index a4705e535..fa2975bd5 100644
--- a/dm/pkg/shardddl/optimism/lock.go
+++ b/dm/pkg/shardddl/optimism/lock.go
@@ -21,9 +21,9 @@ import (
 	"sync"
 
 	"github.com/pingcap/errors"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
 	"github.com/pingcap/tidb/pkg/util/schemacmp"
 	"github.com/pingcap/tiflow/dm/master/metrics"
diff --git a/dm/pkg/utils/common.go b/dm/pkg/utils/common.go
index 417760438..1326097af 100644
--- a/dm/pkg/utils/common.go
+++ b/dm/pkg/utils/common.go
@@ -19,10 +19,10 @@ import (
 	"strings"
 	"sync"
 
-	exprctx "github.com/pingcap/tidb/pkg/expression/context"
-	"github.com/pingcap/tidb/pkg/expression/contextsession"
+	"github.com/pingcap/tidb/pkg/expression/exprctx"
+	"github.com/pingcap/tidb/pkg/expression/sessionexpr"
 	infoschema "github.com/pingcap/tidb/pkg/infoschema/context"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/sessionctx"
 	"github.com/pingcap/tidb/pkg/sessionctx/variable"
 	"github.com/pingcap/tidb/pkg/table"
@@ -214,7 +214,7 @@ func NewSessionCtx(vars map[string]string) sessionctx.Context {
 		values:               make(map[fmt.Stringer]interface{}, 1),
 		builtinFunctionUsage: make(map[string]uint32),
 	}
-	sessionCtx.exprctx = contextsession.NewSessionExprContext(&sessionCtx)
+	sessionCtx.exprctx = sessionexpr.NewExprContext(&sessionCtx)
 	return &sessionCtx
 }
 
diff --git a/dm/simulator/sqlgen/impl.go b/dm/simulator/sqlgen/impl.go
index 07af17d7c..3cd20bd20 100644
--- a/dm/simulator/sqlgen/impl.go
+++ b/dm/simulator/sqlgen/impl.go
@@ -20,7 +20,7 @@ import (
 	"github.com/pingcap/errors"
 	"github.com/pingcap/tidb/pkg/parser/ast"
 	"github.com/pingcap/tidb/pkg/parser/format"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/opcode"
 	_ "github.com/pingcap/tidb/pkg/types/parser_driver" // import this to make the parser work
 	"github.com/pingcap/tiflow/dm/pkg/log"
@@ -69,8 +69,8 @@ func outputString(node ast.Node) (string, error) {
 func (g *sqlGeneratorImpl) GenTruncateTable() (string, error) {
 	truncateTree := &ast.TruncateTableStmt{
 		Table: &ast.TableName{
-			Schema: model.NewCIStr(g.tableConfig.DatabaseName),
-			Name:   model.NewCIStr(g.tableConfig.TableName),
+			Schema: pmodel.NewCIStr(g.tableConfig.DatabaseName),
+			Name:   pmodel.NewCIStr(g.tableConfig.TableName),
 		},
 	}
 	return outputString(truncateTree)
@@ -90,7 +90,7 @@ func (g *sqlGeneratorImpl) generateWhereClause(theUK map[string]interface{}) (as
 			compareExpr = &ast.IsNullExpr{
 				Expr: &ast.ColumnNameExpr{
 					Name: &ast.ColumnName{
-						Name: model.NewCIStr(ukColName),
+						Name: pmodel.NewCIStr(ukColName),
 					},
 				},
 			}
@@ -99,7 +99,7 @@ func (g *sqlGeneratorImpl) generateWhereClause(theUK map[string]interface{}) (as
 				Op: opcode.EQ,
 				L: &ast.ColumnNameExpr{
 					Name: &ast.ColumnName{
-						Name: model.NewCIStr(ukColName),
+						Name: pmodel.NewCIStr(ukColName),
 					},
 				},
 				R: ast.NewValueExpr(val, "", ""),
@@ -144,7 +144,7 @@ func (g *sqlGeneratorImpl) GenUpdateRow(theUK *mcp.UniqueKey) (string, error) {
 		}
 		assignments = append(assignments, &ast.Assignment{
 			Column: &ast.ColumnName{
-				Name: model.NewCIStr(colInfo.ColumnName),
+				Name: pmodel.NewCIStr(colInfo.ColumnName),
 			},
 			Expr: ast.NewValueExpr(util.GenerateDataItem(colInfo.DataType), "", ""),
 		})
@@ -158,8 +158,8 @@ func (g *sqlGeneratorImpl) GenUpdateRow(theUK *mcp.UniqueKey) (string, error) {
 		TableRefs: &ast.TableRefsClause{
 			TableRefs: &ast.Join{
 				Left: &ast.TableName{
-					Schema: model.NewCIStr(g.tableConfig.DatabaseName),
-					Name:   model.NewCIStr(g.tableConfig.TableName),
+					Schema: pmodel.NewCIStr(g.tableConfig.DatabaseName),
+					Name:   pmodel.NewCIStr(g.tableConfig.TableName),
 				},
 			},
 		},
@@ -178,7 +178,7 @@ func (g *sqlGeneratorImpl) GenInsertRow() (string, *mcp.UniqueKey, error) {
 	values := []ast.ExprNode{}
 	for _, col := range g.columnMap {
 		columnNames = append(columnNames, &ast.ColumnName{
-			Name: model.NewCIStr(col.ColumnName),
+			Name: pmodel.NewCIStr(col.ColumnName),
 		})
 		newValue := util.GenerateDataItem(col.DataType)
 		values = append(values, ast.NewValueExpr(newValue, "", ""))
@@ -191,8 +191,8 @@ func (g *sqlGeneratorImpl) GenInsertRow() (string, *mcp.UniqueKey, error) {
 		Table: &ast.TableRefsClause{
 			TableRefs: &ast.Join{
 				Left: &ast.TableName{
-					Schema: model.NewCIStr(g.tableConfig.DatabaseName),
-					Name:   model.NewCIStr(g.tableConfig.TableName),
+					Schema: pmodel.NewCIStr(g.tableConfig.DatabaseName),
+					Name:   pmodel.NewCIStr(g.tableConfig.TableName),
 				},
 			},
 		},
@@ -220,8 +220,8 @@ func (g *sqlGeneratorImpl) GenDeleteRow(theUK *mcp.UniqueKey) (string, error) {
 		TableRefs: &ast.TableRefsClause{
 			TableRefs: &ast.Join{
 				Left: &ast.TableName{
-					Schema: model.NewCIStr(g.tableConfig.DatabaseName),
-					Name:   model.NewCIStr(g.tableConfig.TableName),
+					Schema: pmodel.NewCIStr(g.tableConfig.DatabaseName),
+					Name:   pmodel.NewCIStr(g.tableConfig.TableName),
 				},
 			},
 		},
@@ -241,7 +241,7 @@ func (g *sqlGeneratorImpl) GenLoadUniqueKeySQL() (string, []*config.ColumnDefini
 		selectFields = append(selectFields, &ast.SelectField{
 			Expr: &ast.ColumnNameExpr{
 				Name: &ast.ColumnName{
-					Name: model.NewCIStr(ukColName),
+					Name: pmodel.NewCIStr(ukColName),
 				},
 			},
 		})
@@ -257,8 +257,8 @@ func (g *sqlGeneratorImpl) GenLoadUniqueKeySQL() (string, []*config.ColumnDefini
 		From: &ast.TableRefsClause{
 			TableRefs: &ast.Join{
 				Left: &ast.TableName{
-					Schema: model.NewCIStr(g.tableConfig.DatabaseName),
-					Name:   model.NewCIStr(g.tableConfig.TableName),
+					Schema: pmodel.NewCIStr(g.tableConfig.DatabaseName),
+					Name:   pmodel.NewCIStr(g.tableConfig.TableName),
 				},
 			},
 		},
diff --git a/dm/syncer/checkpoint.go b/dm/syncer/checkpoint.go
index ad65022bb..d227c64c0 100644
--- a/dm/syncer/checkpoint.go
+++ b/dm/syncer/checkpoint.go
@@ -27,7 +27,7 @@ import (
 	"github.com/go-mysql-org/go-mysql/mysql"
 	"github.com/pingcap/errors"
 	"github.com/pingcap/failpoint"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	tmysql "github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
 	"github.com/pingcap/tidb/pkg/util/filter"
diff --git a/dm/syncer/data_validator.go b/dm/syncer/data_validator.go
index 899ab9c15..f471e139d 100644
--- a/dm/syncer/data_validator.go
+++ b/dm/syncer/data_validator.go
@@ -26,7 +26,7 @@ import (
 	"github.com/go-mysql-org/go-mysql/replication"
 	"github.com/pingcap/errors"
 	"github.com/pingcap/failpoint"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/util/filter"
 	cdcmodel "github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/dm/config"
diff --git a/dm/syncer/ddl.go b/dm/syncer/ddl.go
index 84ff95dcb..ff655bb14 100644
--- a/dm/syncer/ddl.go
+++ b/dm/syncer/ddl.go
@@ -21,9 +21,9 @@ import (
 	"github.com/go-mysql-org/go-mysql/replication"
 	"github.com/pingcap/failpoint"
 	tidbddl "github.com/pingcap/tidb/pkg/ddl"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/table"
 	"github.com/pingcap/tidb/pkg/table/tables"
diff --git a/dm/syncer/dml.go b/dm/syncer/dml.go
index fa16077f4..650e3e7dc 100644
--- a/dm/syncer/dml.go
+++ b/dm/syncer/dml.go
@@ -17,8 +17,8 @@ import (
 	"encoding/binary"
 
 	"github.com/pingcap/tidb/pkg/expression"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/charset"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tidb/pkg/util/filter"
diff --git a/dm/syncer/error.go b/dm/syncer/error.go
index ac6ae33ca..390717327 100644
--- a/dm/syncer/error.go
+++ b/dm/syncer/error.go
@@ -24,9 +24,9 @@ import (
 	"github.com/pingcap/failpoint"
 	"github.com/pingcap/tidb/pkg/errno"
 	"github.com/pingcap/tidb/pkg/infoschema"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	tmysql "github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/util/dbterror"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
diff --git a/dm/syncer/expr_filter_group.go b/dm/syncer/expr_filter_group.go
index aca92a6dd..8335b2c87 100644
--- a/dm/syncer/expr_filter_group.go
+++ b/dm/syncer/expr_filter_group.go
@@ -15,7 +15,7 @@ package syncer
 
 import (
 	"github.com/pingcap/tidb/pkg/expression"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/sessionctx"
 	"github.com/pingcap/tidb/pkg/util/chunk"
 	"github.com/pingcap/tidb/pkg/util/dbterror/plannererrors"
diff --git a/dm/syncer/online-ddl-tools/online_ddl.go b/dm/syncer/online-ddl-tools/online_ddl.go
index fdf7a3d02..77b633cd7 100644
--- a/dm/syncer/online-ddl-tools/online_ddl.go
+++ b/dm/syncer/online-ddl-tools/online_ddl.go
@@ -22,7 +22,7 @@ import (
 	"github.com/pingcap/failpoint"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
 	"github.com/pingcap/tidb/pkg/util/filter"
 	"github.com/pingcap/tiflow/dm/config"
@@ -603,7 +603,7 @@ func (r *RealOnlinePlugin) CheckRegex(stmt ast.StmtNode, schema string, flavor c
 	}
 	onlineDDLMatched := allTable
 	tableRecords := make([]*filter.Table, 2)
-	schemaName := model.NewCIStr(schema) // fill schema name
+	schemaName := pmodel.NewCIStr(schema) // fill schema name
 
 	// Online DDL sql example: RENAME TABLE `test`.`t1` TO `test`.`_t1_old`, `test`.`_t1_new` TO `test`.`t1`
 	// We should parse two rename DDL from this DDL:
diff --git a/dm/syncer/schema.go b/dm/syncer/schema.go
index 03b848f6a..7a52dd8f2 100644
--- a/dm/syncer/schema.go
+++ b/dm/syncer/schema.go
@@ -24,9 +24,10 @@ import (
 	ddl2 "github.com/pingcap/tidb/pkg/ddl"
 	"github.com/pingcap/tidb/pkg/executor"
 	"github.com/pingcap/tidb/pkg/meta/autoid"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/ast"
 	"github.com/pingcap/tidb/pkg/parser/format"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/util/filter"
 	"github.com/pingcap/tiflow/dm/config"
 	"github.com/pingcap/tiflow/dm/openapi"
@@ -114,8 +115,8 @@ func (s *Syncer) OperateSchema(ctx context.Context, req *pb.OperateWorkerSchemaR
 			return "", terror.ErrSchemaTrackerInvalidCreateTableStmt.Generate(req.Schema)
 		}
 		// ensure correct table name.
-		stmt.Table.Schema = model.NewCIStr(req.Database)
-		stmt.Table.Name = model.NewCIStr(req.Table)
+		stmt.Table.Schema = pmodel.NewCIStr(req.Database)
+		stmt.Table.Name = pmodel.NewCIStr(req.Table)
 		stmt.IfNotExists = false // we must ensure drop the previous one.
 
 		var newCreateSQLBuilder strings.Builder
diff --git a/dm/syncer/shardddl/optimist.go b/dm/syncer/shardddl/optimist.go
index e6a1b04e0..94707693a 100644
--- a/dm/syncer/shardddl/optimist.go
+++ b/dm/syncer/shardddl/optimist.go
@@ -18,7 +18,7 @@ import (
 	"sync"
 	"time"
 
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	filter "github.com/pingcap/tidb/pkg/util/table-filter"
 	tcontext "github.com/pingcap/tiflow/dm/pkg/context"
 	"github.com/pingcap/tiflow/dm/pkg/etcdutil"
diff --git a/dm/syncer/syncer.go b/dm/syncer/syncer.go
index 57622a69f..ef2170c82 100644
--- a/dm/syncer/syncer.go
+++ b/dm/syncer/syncer.go
@@ -32,9 +32,10 @@ import (
 	"github.com/pingcap/errors"
 	"github.com/pingcap/failpoint"
 	tidbddl "github.com/pingcap/tidb/pkg/ddl"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/sessionctx"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
 	"github.com/pingcap/tidb/pkg/util/filter"
@@ -881,8 +882,8 @@ func (s *Syncer) trackTableInfoFromDownstream(tctx *tcontext.Context, sourceTabl
 	}
 	createStmt := createNode.(*ast.CreateTableStmt)
 	createStmt.IfNotExists = true
-	createStmt.Table.Schema = model.NewCIStr(sourceTable.Schema)
-	createStmt.Table.Name = model.NewCIStr(sourceTable.Name)
+	createStmt.Table.Schema = pmodel.NewCIStr(sourceTable.Schema)
+	createStmt.Table.Name = pmodel.NewCIStr(sourceTable.Name)
 
 	// schema tracker sets non-clustered index, so can't handle auto_random.
 	for _, col := range createStmt.Cols {
diff --git a/dm/syncer/validate_worker.go b/dm/syncer/validate_worker.go
index 4fbfdd9d5..a32d87690 100644
--- a/dm/syncer/validate_worker.go
+++ b/dm/syncer/validate_worker.go
@@ -26,7 +26,7 @@ import (
 	"github.com/docker/go-units"
 	"github.com/pingcap/errors"
 	"github.com/pingcap/failpoint"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	tidbmysql "github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
 	"github.com/pingcap/tidb/pkg/util/filter"
diff --git a/dm/syncer/validator_cond.go b/dm/syncer/validator_cond.go
index 7b60a9eaa..4c4d0e04a 100644
--- a/dm/syncer/validator_cond.go
+++ b/dm/syncer/validator_cond.go
@@ -16,7 +16,7 @@ package syncer
 import (
 	"strings"
 
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 )
 
 type Cond struct {
diff --git a/engine/jobmaster/dm/checkpoint/agent.go b/engine/jobmaster/dm/checkpoint/agent.go
index 4f8e63b20..fb240c4f1 100644
--- a/engine/jobmaster/dm/checkpoint/agent.go
+++ b/engine/jobmaster/dm/checkpoint/agent.go
@@ -24,7 +24,7 @@ import (
 	"github.com/coreos/go-semver/semver"
 	"github.com/pingcap/tidb/pkg/executor"
 	"github.com/pingcap/tidb/pkg/meta/autoid"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/util/filter"
 	"github.com/pingcap/tidb/pkg/util/mock"
 	regexprrouter "github.com/pingcap/tidb/pkg/util/regexpr-router"
diff --git a/engine/jobmaster/dm/ddl_coordinator.go b/engine/jobmaster/dm/ddl_coordinator.go
index 7aea126ab..bdf26cee2 100644
--- a/engine/jobmaster/dm/ddl_coordinator.go
+++ b/engine/jobmaster/dm/ddl_coordinator.go
@@ -19,9 +19,9 @@ import (
 	"sync"
 
 	"github.com/pingcap/tidb/pkg/ddl"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/util/schemacmp"
 	"github.com/pingcap/tiflow/dm/pkg/log"
 	"github.com/pingcap/tiflow/dm/pkg/shardddl/optimism"
diff --git a/go.mod b/go.mod
index ce849e2aa..c01103115 100644
--- a/go.mod
+++ b/go.mod
@@ -56,7 +56,7 @@ require (
 	github.com/jcmturner/gokrb5/v8 v8.4.4
 	github.com/jmoiron/sqlx v1.3.3
 	github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d
-	github.com/klauspost/compress v1.17.8
+	github.com/klauspost/compress v1.17.9
 	github.com/labstack/gommon v0.4.0
 	github.com/linkedin/goavro/v2 v2.11.1
 	github.com/mailru/easyjson v0.7.7
@@ -69,10 +69,10 @@ require (
 	github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
 	github.com/pingcap/kvproto v0.0.0-20240911085438-1a933d30690a
 	github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d
-	github.com/pingcap/tidb v1.1.0-beta.0.20240722024203-504960d51b2a
+	github.com/pingcap/tidb v1.1.0-beta.0.20240920050217-adbc0034ffb4
 	github.com/pingcap/tidb-dashboard v0.0.0-20240326110213-9768844ff5d7
-	github.com/pingcap/tidb/pkg/parser v0.0.0-20240722015532-8edd4ed54376
-	github.com/prometheus/client_golang v1.19.1
+	github.com/pingcap/tidb/pkg/parser v0.0.0-20240920050217-adbc0034ffb4
+	github.com/prometheus/client_golang v1.20.2
 	github.com/prometheus/client_model v0.6.1
 	github.com/r3labs/diff v1.1.0
 	github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
@@ -89,9 +89,9 @@ require (
 	github.com/swaggo/swag v1.16.3
 	github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954
 	github.com/thanhpk/randstr v1.0.6
-	github.com/tikv/client-go/v2 v2.0.8-0.20240703095801-d73cc1ed6503
+	github.com/tikv/client-go/v2 v2.0.8-0.20240911041506-e7894a7b27ba
 	github.com/tikv/pd v1.1.0-beta.0.20240407022249-7179657d129b
-	github.com/tikv/pd/client v0.0.0-20240717053728-5ec6af403019
+	github.com/tikv/pd/client v0.0.0-20240914083230-71f6f96816e9
 	github.com/tinylib/msgp v1.1.6
 	github.com/uber-go/atomic v1.4.0
 	github.com/vmihailenco/msgpack/v5 v5.3.5
@@ -111,19 +111,19 @@ require (
 	go.uber.org/ratelimit v0.2.0
 	go.uber.org/zap v1.27.0
 	golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8
-	golang.org/x/net v0.27.0
+	golang.org/x/net v0.28.0
 	golang.org/x/oauth2 v0.21.0
-	golang.org/x/sync v0.7.0
-	golang.org/x/sys v0.22.0
-	golang.org/x/text v0.16.0
+	golang.org/x/sync v0.8.0
+	golang.org/x/sys v0.25.0
+	golang.org/x/text v0.18.0
 	golang.org/x/time v0.5.0
 	google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda
 	google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291
 	google.golang.org/grpc v1.64.0
 	google.golang.org/protobuf v1.34.2
 	gopkg.in/yaml.v2 v2.4.0
-	gorm.io/driver/mysql v1.4.5
-	gorm.io/gorm v1.24.5
+	gorm.io/driver/mysql v1.5.7
+	gorm.io/gorm v1.25.11
 	upper.io/db.v3 v3.7.1+incompatible
 )
 
@@ -309,7 +309,7 @@ require (
 	github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect
 	github.com/mattn/go-colorable v0.1.13 // indirect
 	github.com/mattn/go-isatty v0.0.20 // indirect
-	github.com/mattn/go-runewidth v0.0.15 // indirect
+	github.com/mattn/go-runewidth v0.0.16 // indirect
 	github.com/mattn/go-sqlite3 v2.0.1+incompatible // indirect
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/mtibben/percent v0.2.1 // indirect
@@ -321,25 +321,25 @@ require (
 	github.com/opentracing/basictracer-go v1.1.0 // indirect
 	github.com/opentracing/opentracing-go v1.2.0 // indirect
 	github.com/pelletier/go-toml/v2 v2.0.8 // indirect
-	github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect
+	github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
 	github.com/philhofer/fwd v1.1.1 // indirect
 	github.com/pierrec/lz4 v2.6.1+incompatible // indirect
 	github.com/pingcap/badger v1.5.1-0.20230103063557-828f39b09b6d // indirect
 	github.com/pingcap/fn v1.0.0 // indirect
 	github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 // indirect
 	github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5
-	github.com/pingcap/tipb v0.0.0-20240318032315-55a7867ddd50 // indirect
+	github.com/pingcap/tipb v0.0.0-20240823074000-a40c2347786e // indirect
 	github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
 	github.com/pkg/errors v0.9.1 // indirect
 	github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
 	github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
-	github.com/prometheus/common v0.55.0 // indirect
+	github.com/prometheus/common v0.57.0 // indirect
 	github.com/prometheus/procfs v0.15.1 // indirect
 	github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
 	github.com/rivo/uniseg v0.4.7 // indirect
 	github.com/rogpeppe/go-internal v1.12.0 // indirect
 	github.com/rs/cors v1.7.0 // indirect
-	github.com/sasha-s/go-deadlock v0.3.1 // indirect
+	github.com/sasha-s/go-deadlock v0.3.5 // indirect
 	github.com/shoenig/go-m1cpu v0.1.6 // indirect
 	github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
 	github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0 // indirect
@@ -380,10 +380,10 @@ require (
 	go.opentelemetry.io/otel/sdk v1.24.0 // indirect
 	go.opentelemetry.io/otel/trace v1.24.0 // indirect
 	go.opentelemetry.io/proto/otlp v1.1.0 // indirect
-	golang.org/x/crypto v0.25.0 // indirect
-	golang.org/x/mod v0.18.0 // indirect
-	golang.org/x/term v0.22.0
-	golang.org/x/tools v0.22.0 // indirect
+	golang.org/x/crypto v0.27.0 // indirect
+	golang.org/x/mod v0.20.0 // indirect
+	golang.org/x/term v0.24.0
+	golang.org/x/tools v0.24.0 // indirect
 	google.golang.org/api v0.170.0 // indirect
 	gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
 	gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
diff --git a/go.sum b/go.sum
index 2ebe53e4f..d2b21c92f 100644
--- a/go.sum
+++ b/go.sum
@@ -425,10 +425,12 @@ github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqx
 github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A=
 github.com/go-session/session v3.1.2+incompatible/go.mod h1:8B3iivBQjrz/JtC68Np2T1yBBLxTan3mn/3OM0CyRt0=
 github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
-github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
 github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
 github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
+github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
 github.com/goccy/go-json v0.7.8/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
 github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
 github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
@@ -637,7 +639,6 @@ github.com/jfcg/sorty/v2 v2.1.0/go.mod h1:JpcSKlmtGOOAGyTdWN2ErjvxeMSJVYBsylAKep
 github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74=
 github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
 github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
-github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
 github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
@@ -686,8 +687,8 @@ github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0
 github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
 github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
 github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
-github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=
-github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
+github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
+github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
 github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
 github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s=
 github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4=
@@ -773,8 +774,8 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D
 github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
 github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
 github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
-github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
-github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
+github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
+github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
 github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
 github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
@@ -860,9 +861,8 @@ github.com/pborman/getopt v0.0.0-20180729010549-6fdd0a2c7117/go.mod h1:85jBQOZwp
 github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
 github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
 github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
-github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o=
-github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU=
-github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
+github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw=
+github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
 github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc=
 github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
 github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ=
@@ -901,14 +901,14 @@ github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d h1:y3EueKVfVykdpTyfU
 github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d/go.mod h1:ORfBOFp1eteu2odzsyaxI+b8TzJwgjwyQcGhI+9SfEA=
 github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5 h1:T4pXRhBflzDeAhmOQHNPRRogMYxP13V7BkYw3ZsoSfE=
 github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5/go.mod h1:rlimy0GcTvjiJqvD5mXTRr8O2eNZPBrcUgiWVYp9530=
-github.com/pingcap/tidb v1.1.0-beta.0.20240722024203-504960d51b2a h1:lIj1fFRvB1EwU5005B7vlAl5eu1LUg18FTw83X5Ed1A=
-github.com/pingcap/tidb v1.1.0-beta.0.20240722024203-504960d51b2a/go.mod h1:2FO9Yzc8HOYk+aZRYrguuwN6OS12TE+OA2RtukAS+Z8=
+github.com/pingcap/tidb v1.1.0-beta.0.20240920050217-adbc0034ffb4 h1:BnoMi+RibczSp8TjfPcvb2RVviQQvIjfqDM8fn4/xwU=
+github.com/pingcap/tidb v1.1.0-beta.0.20240920050217-adbc0034ffb4/go.mod h1:XqXA8+jTqBZ4bu/xNjWSzBK33nIB1z0adUv0vYXQgVE=
 github.com/pingcap/tidb-dashboard v0.0.0-20240326110213-9768844ff5d7 h1:eFu98FbfJB7PKWOtkaV6YNXXJWqDhczQX56j/iucgU4=
 github.com/pingcap/tidb-dashboard v0.0.0-20240326110213-9768844ff5d7/go.mod h1:ucZBRz52icb23T/5Z4CsuUHmarYiin7p2MeiVBe+o8c=
-github.com/pingcap/tidb/pkg/parser v0.0.0-20240722015532-8edd4ed54376 h1:tz757zpST60fweJB5ZjVl74kQGbRrpmIiTtF6BdnMow=
-github.com/pingcap/tidb/pkg/parser v0.0.0-20240722015532-8edd4ed54376/go.mod h1:c/4la2yfv1vBYvtIG8WCDyDinLMDIUC5+zLRHiafY+Y=
-github.com/pingcap/tipb v0.0.0-20240318032315-55a7867ddd50 h1:fVNBE06Rjec+EIHaYAKAHa/bIt5lnu3Zh9O6kV7ZAdg=
-github.com/pingcap/tipb v0.0.0-20240318032315-55a7867ddd50/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs=
+github.com/pingcap/tidb/pkg/parser v0.0.0-20240920050217-adbc0034ffb4 h1:GBf6ho/7J4HVf5N+DaCfUfP7B0Yt1k48GgMBv/SvBjs=
+github.com/pingcap/tidb/pkg/parser v0.0.0-20240920050217-adbc0034ffb4/go.mod h1:bGciNq+1X3xXPyRvgHFPKh2naQVH6HPiBbfqK3qSqpw=
+github.com/pingcap/tipb v0.0.0-20240823074000-a40c2347786e h1:chR6iRwU9MUivOYNH+26UqrO8Y7t3ZltX+Jukv+f+iM=
+github.com/pingcap/tipb v0.0.0-20240823074000-a40c2347786e/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs=
 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
 github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
@@ -925,15 +925,15 @@ github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:Om
 github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3gMACTjAbMZBjXAqTOzOwFaj2Ld6cjeQ7Rig=
 github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
 github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
-github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
-github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
+github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg=
+github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
 github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
 github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
 github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
-github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
-github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
+github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY=
+github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI=
 github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
 github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
@@ -974,8 +974,8 @@ github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfF
 github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk=
 github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 h1:GHRpF1pTW19a8tTFrMLUcfWwyC0pnifVo2ClaLq+hP8=
 github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46/go.mod h1:uAQ5PCi+MFsC7HjREoAz1BU+Mq60+05gifQSsHSDG/8=
-github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0=
-github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
+github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU=
+github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U=
 github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
 github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
 github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
@@ -1104,12 +1104,12 @@ github.com/tidwall/rtree v0.0.0-20180113144539-6cd427091e0e/go.mod h1:/h+UnNGt0I
 github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563/go.mod h1:mLqSmt7Dv/CNneF2wfcChfN1rvapyQr01LGKnKex0DQ=
 github.com/tidwall/tinyqueue v0.1.1 h1:SpNEvEggbpyN5DIReaJ2/1ndroY8iyEGxPYxoSaymYE=
 github.com/tidwall/tinyqueue v0.1.1/go.mod h1:O/QNHwrnjqr6IHItYrzoHAKYhBkLI67Q096fQP5zMYw=
-github.com/tikv/client-go/v2 v2.0.8-0.20240703095801-d73cc1ed6503 h1:0mUlg3+dA5LvwKs1U6i/ID/8RsYgLVLGyM8fSBMb630=
-github.com/tikv/client-go/v2 v2.0.8-0.20240703095801-d73cc1ed6503/go.mod h1:4HDOAx8OXAJPtqhCZ03IhChXgaFs4B3+vSrPWmiPxjg=
+github.com/tikv/client-go/v2 v2.0.8-0.20240911041506-e7894a7b27ba h1:dwuuYqPYxU0xcv0bnDgT7I4btQ5c3joBG1HmNOhCTdo=
+github.com/tikv/client-go/v2 v2.0.8-0.20240911041506-e7894a7b27ba/go.mod h1:4HDOAx8OXAJPtqhCZ03IhChXgaFs4B3+vSrPWmiPxjg=
 github.com/tikv/pd v1.1.0-beta.0.20240407022249-7179657d129b h1:t2XoZp4UHrkPpYPsxbRTRVExJnriWlh+ZsDIfpYyd98=
 github.com/tikv/pd v1.1.0-beta.0.20240407022249-7179657d129b/go.mod h1:7HJMdb0O5umNpZIFt8e/wKAcEmH99n2HsYgXX+vZj3k=
-github.com/tikv/pd/client v0.0.0-20240717053728-5ec6af403019 h1:7VoatJKzIrsjepOaXQjpAcgxQrx2QBAI4HuZ0wFdinA=
-github.com/tikv/pd/client v0.0.0-20240717053728-5ec6af403019/go.mod h1:QeMzXKDOW+GbbE+ckcVPBVS6vX3//QB99dXU+niYRq0=
+github.com/tikv/pd/client v0.0.0-20240914083230-71f6f96816e9 h1:J9LChGMzo95eBrjE03NHITDWgxfPgskH+QrCnlW61/Y=
+github.com/tikv/pd/client v0.0.0-20240914083230-71f6f96816e9/go.mod h1:uBHhxAM/SPCMabt483gI/pN/+JXIMKYXohK96s+PwT8=
 github.com/tinylib/msgp v1.1.6 h1:i+SbKraHhnrf9M5MYmvQhFnbLhAXSDWF8WWsuyRdocw=
 github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw=
 github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs=
@@ -1297,8 +1297,8 @@ golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0
 golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
 golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
 golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
-golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
-golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
+golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
+golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
 golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -1354,8 +1354,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
-golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
+golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
 golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1399,8 +1399,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
 golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
 golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
 golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
-golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
-golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
+golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
+golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -1419,8 +1419,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
-golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
+golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
 golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -1495,8 +1495,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
-golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
+golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -1505,8 +1505,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
 golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
 golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
 golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
-golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk=
-golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
+golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
+golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -1521,8 +1521,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
 golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
 golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
 golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
-golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
-golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
+golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
+golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -1586,8 +1586,8 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
 golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
 golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
-golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
-golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
+golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
+golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -1730,11 +1730,11 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C
 gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
 gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gorm.io/driver/mysql v1.3.3 h1:jXG9ANrwBc4+bMvBcSl8zCfPBaVoPyBEBshA8dA93X8=
-gorm.io/driver/mysql v1.3.3/go.mod h1:ChK6AHbHgDCFZyJp0F+BmVGb06PSIoh9uVYKAlRbb2U=
-gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
-gorm.io/gorm v1.24.5 h1:g6OPREKqqlWq4kh/3MCQbZKImeB9e6Xgc4zD+JgNZGE=
-gorm.io/gorm v1.24.5/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
+gorm.io/driver/mysql v1.5.7 h1:MndhOPYOfEp2rHKgkZIhJ16eVUIRf2HmzgoPmh7FCWo=
+gorm.io/driver/mysql v1.5.7/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM=
+gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
+gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg=
+gorm.io/gorm v1.25.11/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/pkg/applier/redo.go b/pkg/applier/redo.go
index fe176b572..96771ffc2 100644
--- a/pkg/applier/redo.go
+++ b/pkg/applier/redo.go
@@ -21,7 +21,7 @@ import (
 	"time"
 
 	"github.com/pingcap/log"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/cdc/model/codec"
 	"github.com/pingcap/tiflow/cdc/processor/memquota"
diff --git a/pkg/diff/chunk.go b/pkg/diff/chunk.go
index 158549bed..84ba6d8c1 100644
--- a/pkg/diff/chunk.go
+++ b/pkg/diff/chunk.go
@@ -23,7 +23,7 @@ import (
 
 	"github.com/pingcap/errors"
 	"github.com/pingcap/log"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
 	"go.uber.org/zap"
 )
diff --git a/pkg/diff/diff.go b/pkg/diff/diff.go
index cfac1b9d0..7d1a41ef7 100644
--- a/pkg/diff/diff.go
+++ b/pkg/diff/diff.go
@@ -30,7 +30,7 @@ import (
 	"github.com/pingcap/errors"
 	"github.com/pingcap/failpoint"
 	"github.com/pingcap/log"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
 	"github.com/pingcap/tidb/pkg/util/dbutil/dbutiltest"
 	"go.uber.org/zap"
diff --git a/pkg/diff/merge.go b/pkg/diff/merge.go
index 2b3139699..a36f176e9 100644
--- a/pkg/diff/merge.go
+++ b/pkg/diff/merge.go
@@ -17,7 +17,7 @@ import (
 	"strconv"
 
 	"github.com/pingcap/log"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
 	"go.uber.org/zap"
 )
diff --git a/pkg/diff/util.go b/pkg/diff/util.go
index 338684d93..3d8355eb5 100644
--- a/pkg/diff/util.go
+++ b/pkg/diff/util.go
@@ -18,7 +18,7 @@ import (
 	"strings"
 
 	"github.com/pingcap/log"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/types"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
 	"go.uber.org/zap"
diff --git a/pkg/filter/filter.go b/pkg/filter/filter.go
index fb5b54782..1160c1b0e 100644
--- a/pkg/filter/filter.go
+++ b/pkg/filter/filter.go
@@ -14,7 +14,7 @@
 package filter
 
 import (
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	tfilter "github.com/pingcap/tidb/pkg/util/table-filter"
 	"github.com/pingcap/tiflow/cdc/model"
 	bf "github.com/pingcap/tiflow/pkg/binlog-filter"
diff --git a/pkg/filter/utils.go b/pkg/filter/utils.go
index 808b6803a..910ef4177 100644
--- a/pkg/filter/utils.go
+++ b/pkg/filter/utils.go
@@ -16,7 +16,7 @@ package filter
 import (
 	"fmt"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	tifilter "github.com/pingcap/tidb/pkg/util/filter"
 	tfilter "github.com/pingcap/tidb/pkg/util/table-filter"
 	bf "github.com/pingcap/tiflow/pkg/binlog-filter"
diff --git a/pkg/sink/cloudstorage/table_definition.go b/pkg/sink/cloudstorage/table_definition.go
index 2efb7b5e3..e48b4e745 100644
--- a/pkg/sink/cloudstorage/table_definition.go
+++ b/pkg/sink/cloudstorage/table_definition.go
@@ -19,8 +19,9 @@ import (
 	"strings"
 
 	"github.com/pingcap/log"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/charset"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -113,7 +114,7 @@ func (t *TableCol) ToTiColumnInfo(colID int64) (*timodel.ColumnInfo, error) {
 	}
 
 	col.ID = colID
-	col.Name = timodel.NewCIStr(t.Name)
+	col.Name = pmodel.NewCIStr(t.Name)
 	tp := types.StrToType(strings.ToLower(strings.TrimSuffix(t.Tp, " UNSIGNED")))
 	col.FieldType = *types.NewFieldType(tp)
 	if strings.Contains(t.Tp, "UNSIGNED") {
@@ -251,7 +252,7 @@ func (t *TableDefinition) FromTableInfo(
 // ToTableInfo converts from TableDefinition to DDLEvent.
 func (t *TableDefinition) ToTableInfo() (*model.TableInfo, error) {
 	tidbTableInfo := &timodel.TableInfo{
-		Name: timodel.NewCIStr(t.Table),
+		Name: pmodel.NewCIStr(t.Table),
 	}
 	nextMockID := int64(100) // 100 is an arbitrary number
 	for _, col := range t.Columns {
diff --git a/pkg/sink/codec/avro/avro.go b/pkg/sink/codec/avro/avro.go
index 10222296a..36291ca02 100644
--- a/pkg/sink/codec/avro/avro.go
+++ b/pkg/sink/codec/avro/avro.go
@@ -26,7 +26,7 @@ import (
 	"github.com/linkedin/goavro/v2"
 	"github.com/pingcap/errors"
 	"github.com/pingcap/log"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/types"
 	"github.com/pingcap/tidb/pkg/util/rowcodec"
diff --git a/pkg/sink/codec/canal/canal_entry.go b/pkg/sink/codec/canal/canal_entry.go
index e4724a525..0b7ed26da 100644
--- a/pkg/sink/codec/canal/canal_entry.go
+++ b/pkg/sink/codec/canal/canal_entry.go
@@ -21,8 +21,8 @@ import (
 
 	"github.com/golang/protobuf/proto" // nolint:staticcheck
 	"github.com/pingcap/errors"
-	mm "github.com/pingcap/tidb/pkg/parser/model"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	mm "github.com/pingcap/tidb/pkg/meta/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tiflow/cdc/model"
 	cerror "github.com/pingcap/tiflow/pkg/errors"
@@ -266,7 +266,7 @@ func convertDdlEventType(e *model.DDLEvent) canal.EventType {
 		mm.ActionDropView, mm.ActionRecoverTable, mm.ActionModifySchemaCharsetAndCollate,
 		mm.ActionLockTable, mm.ActionUnlockTable, mm.ActionRepairTable, mm.ActionSetTiFlashReplica,
 		mm.ActionUpdateTiFlashReplicaStatus, mm.ActionCreateSequence, mm.ActionAlterSequence,
-		mm.ActionDropSequence, mm.ActionModifyTableAutoIdCache, mm.ActionRebaseAutoRandomBase:
+		mm.ActionDropSequence, mm.ActionModifyTableAutoIDCache, mm.ActionRebaseAutoRandomBase:
 		return canal.EventType_QUERY
 	case mm.ActionCreateTable:
 		return canal.EventType_CREATE
diff --git a/pkg/sink/codec/canal/canal_json_message.go b/pkg/sink/codec/canal/canal_json_message.go
index 3072af553..8467f7cb6 100644
--- a/pkg/sink/codec/canal/canal_json_message.go
+++ b/pkg/sink/codec/canal/canal_json_message.go
@@ -19,7 +19,7 @@ import (
 	"strings"
 
 	"github.com/pingcap/log"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tiflow/cdc/model"
 	cerrors "github.com/pingcap/tiflow/pkg/errors"
diff --git a/pkg/sink/codec/common/verify_checksum.go b/pkg/sink/codec/common/verify_checksum.go
index 2557b39ef..3e91a7804 100644
--- a/pkg/sink/codec/common/verify_checksum.go
+++ b/pkg/sink/codec/common/verify_checksum.go
@@ -24,7 +24,7 @@ import (
 
 	"github.com/pingcap/errors"
 	"github.com/pingcap/log"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/pkg/util"
diff --git a/pkg/sink/codec/craft/message_decoder.go b/pkg/sink/codec/craft/message_decoder.go
index 81d7bd885..037988269 100644
--- a/pkg/sink/codec/craft/message_decoder.go
+++ b/pkg/sink/codec/craft/message_decoder.go
@@ -19,7 +19,7 @@ import (
 	"unsafe"
 
 	"github.com/pingcap/errors"
-	pmodel "github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tiflow/cdc/model"
 	cerror "github.com/pingcap/tiflow/pkg/errors"
diff --git a/pkg/sink/codec/csv/csv_message.go b/pkg/sink/codec/csv/csv_message.go
index 32486b2fe..673cf499e 100644
--- a/pkg/sink/codec/csv/csv_message.go
+++ b/pkg/sink/codec/csv/csv_message.go
@@ -22,8 +22,8 @@ import (
 
 	"github.com/pingcap/errors"
 	"github.com/pingcap/tidb/pkg/kv"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/charset"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/types"
 	"github.com/pingcap/tiflow/cdc/model"
diff --git a/pkg/sink/codec/maxwell/maxwell_message.go b/pkg/sink/codec/maxwell/maxwell_message.go
index 9d0de05db..985bbb492 100644
--- a/pkg/sink/codec/maxwell/maxwell_message.go
+++ b/pkg/sink/codec/maxwell/maxwell_message.go
@@ -16,7 +16,7 @@ package maxwell
 import (
 	"encoding/json"
 
-	model2 "github.com/pingcap/tidb/pkg/parser/model"
+	model2 "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tiflow/cdc/model"
 	cerror "github.com/pingcap/tiflow/pkg/errors"
diff --git a/pkg/sink/codec/open/open_protocol_message.go b/pkg/sink/codec/open/open_protocol_message.go
index 77829e699..2e2a64df5 100644
--- a/pkg/sink/codec/open/open_protocol_message.go
+++ b/pkg/sink/codec/open/open_protocol_message.go
@@ -19,7 +19,7 @@ import (
 	"sort"
 	"strings"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	cerror "github.com/pingcap/tiflow/pkg/errors"
 	"github.com/pingcap/tiflow/pkg/sink/codec"
diff --git a/pkg/sink/codec/simple/message.go b/pkg/sink/codec/simple/message.go
index fe7ab2512..26afea312 100644
--- a/pkg/sink/codec/simple/message.go
+++ b/pkg/sink/codec/simple/message.go
@@ -22,7 +22,8 @@ import (
 	"time"
 
 	"github.com/pingcap/log"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	tiTypes "github.com/pingcap/tidb/pkg/types"
@@ -162,7 +163,7 @@ func newTiColumnInfo(
 ) *timodel.ColumnInfo {
 	col := new(timodel.ColumnInfo)
 	col.ID = colID
-	col.Name = timodel.NewCIStr(column.Name)
+	col.Name = pmodel.NewCIStr(column.Name)
 
 	col.FieldType = *types.NewFieldType(types.StrToType(column.DataType.MySQLType))
 	col.SetCharset(column.DataType.Charset)
@@ -256,14 +257,14 @@ func newTiIndexInfo(indexSchema *IndexSchema, columns []*timodel.ColumnInfo, ind
 			}
 		}
 		indexColumns[i] = &timodel.IndexColumn{
-			Name:   timodel.NewCIStr(col),
+			Name:   pmodel.NewCIStr(col),
 			Offset: offset,
 		}
 	}
 
 	return &timodel.IndexInfo{
 		ID:      indexID,
-		Name:    timodel.NewCIStr(indexSchema.Name),
+		Name:    pmodel.NewCIStr(indexSchema.Name),
 		Columns: indexColumns,
 		Unique:  indexSchema.Unique,
 		Primary: indexSchema.Primary,
@@ -339,7 +340,7 @@ func newTableInfo(m *TableSchema) *model.TableInfo {
 		schemaVersion = m.Version
 
 		tidbTableInfo.ID = m.TableID
-		tidbTableInfo.Name = timodel.NewCIStr(m.Table)
+		tidbTableInfo.Name = pmodel.NewCIStr(m.Table)
 		tidbTableInfo.UpdateTS = m.Version
 
 		nextMockID := int64(100)
diff --git a/pkg/sink/codec/utils/mysql_types.go b/pkg/sink/codec/utils/mysql_types.go
index a88062135..120752153 100644
--- a/pkg/sink/codec/utils/mysql_types.go
+++ b/pkg/sink/codec/utils/mysql_types.go
@@ -16,7 +16,7 @@ package utils
 import (
 	"strings"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 )
diff --git a/pkg/sqlmodel/causality.go b/pkg/sqlmodel/causality.go
index c768889a5..b398a75a7 100644
--- a/pkg/sqlmodel/causality.go
+++ b/pkg/sqlmodel/causality.go
@@ -18,7 +18,7 @@ import (
 	"strconv"
 	"strings"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/sessionctx"
 	"github.com/pingcap/tidb/pkg/tablecodec"
diff --git a/pkg/sqlmodel/row_change.go b/pkg/sqlmodel/row_change.go
index a8fa76835..8599aa64b 100644
--- a/pkg/sqlmodel/row_change.go
+++ b/pkg/sqlmodel/row_change.go
@@ -18,7 +18,7 @@ import (
 	"strings"
 
 	"github.com/pingcap/failpoint"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/sessionctx"
 	cdcmodel "github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/dm/pkg/log"
diff --git a/pkg/sqlmodel/utils.go b/pkg/sqlmodel/utils.go
index e7db35ae5..75a69cdc9 100644
--- a/pkg/sqlmodel/utils.go
+++ b/pkg/sqlmodel/utils.go
@@ -17,7 +17,7 @@ import (
 	"fmt"
 	"strings"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 )
 
 func getColsAndValuesOfIdx(
diff --git a/pkg/sqlmodel/where_handle.go b/pkg/sqlmodel/where_handle.go
index b6d16f4cc..b2c1b7996 100644
--- a/pkg/sqlmodel/where_handle.go
+++ b/pkg/sqlmodel/where_handle.go
@@ -15,7 +15,8 @@ package sqlmodel
 
 import (
 	"github.com/pingcap/log"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/types"
 )
@@ -102,7 +103,7 @@ func getPKIsHandleIdx(ti *model.TableInfo) *model.IndexInfo {
 			Unique:  true,
 			Primary: true,
 			State:   model.StatePublic,
-			Tp:      model.IndexTypeBtree,
+			Tp:      pmodel.IndexTypeBtree,
 			Columns: []*model.IndexColumn{{
 				Name:   pk.Name,
 				Offset: pk.Offset,


Test patch:
diff --git a/cdc/entry/mounter_test.go b/cdc/entry/mounter_test.go
index 739080d63..e563ba9c5 100644
--- a/cdc/entry/mounter_test.go
+++ b/cdc/entry/mounter_test.go
@@ -27,9 +27,9 @@ import (
 	"github.com/pingcap/tidb/pkg/executor"
 	tidbkv "github.com/pingcap/tidb/pkg/kv"
 	"github.com/pingcap/tidb/pkg/meta/autoid"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/session"
 	"github.com/pingcap/tidb/pkg/store/mockstore"
@@ -269,7 +269,7 @@ func testMounterDisableOldValue(t *testing.T, tc struct {
 	ticonfig.UpdateGlobal(func(conf *ticonfig.Config) {
 		// we can update the tidb config here
 	})
-	session.SetSchemaLease(0)
+	session.SetSchemaLease(time.Second)
 	session.DisableStats4Test()
 	domain, err := session.BootstrapSession(store)
 	require.Nil(t, err)
diff --git a/cdc/entry/schema/snapshot_test.go b/cdc/entry/schema/snapshot_test.go
index a1c26c8d6..82a098aa9 100644
--- a/cdc/entry/schema/snapshot_test.go
+++ b/cdc/entry/schema/snapshot_test.go
@@ -17,7 +17,8 @@ import (
 	"fmt"
 	"testing"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/stretchr/testify/require"
 )
@@ -79,7 +80,7 @@ func TestSchema(t *testing.T) {
 	snap := NewEmptySnapshot(true)
 
 	// createSchema fails if the schema ID or name already exist.
-	dbName := timodel.CIStr{O: "DB_1", L: "db_1"}
+	dbName := pmodel.CIStr{O: "DB_1", L: "db_1"}
 	require.Nil(t, snap.inner.createSchema(&timodel.DBInfo{ID: 1, Name: dbName}, 100))
 	require.Nil(t, snap.inner.createTable(newTbInfo(1, "DB_1", 11), 100))
 	require.Error(t, snap.inner.createSchema(&timodel.DBInfo{ID: 1}, 110))
@@ -87,7 +88,7 @@ func TestSchema(t *testing.T) {
 	snap1 := snap.Copy()
 
 	// replaceSchema only success if the schema ID exists.
-	dbName = timodel.CIStr{O: "DB_2", L: "db_2"}
+	dbName = pmodel.CIStr{O: "DB_2", L: "db_2"}
 	require.Error(t, snap.inner.replaceSchema(&timodel.DBInfo{ID: 2}, 130))
 	require.Nil(t, snap.inner.replaceSchema(&timodel.DBInfo{ID: 1, Name: dbName}, 140))
 	snap2 := snap.Copy()
@@ -354,7 +355,7 @@ func TestDrop(t *testing.T) {
 func newDBInfo(id int64) *timodel.DBInfo {
 	return &timodel.DBInfo{
 		ID: id,
-		Name: timodel.CIStr{
+		Name: pmodel.CIStr{
 			O: fmt.Sprintf("DB_%d", id),
 			L: fmt.Sprintf("db_%d", id),
 		},
@@ -367,7 +368,7 @@ func newTbInfo(schemaID int64, schemaName string, tableID int64) *model.TableInf
 	return &model.TableInfo{
 		TableInfo: &timodel.TableInfo{
 			ID: tableID,
-			Name: timodel.CIStr{
+			Name: pmodel.CIStr{
 				O: fmt.Sprintf("TB_%d", tableID),
 				L: fmt.Sprintf("TB_%d", tableID),
 			},
diff --git a/cdc/entry/schema_storage_test.go b/cdc/entry/schema_storage_test.go
index 4ae582897..f70634c97 100644
--- a/cdc/entry/schema_storage_test.go
+++ b/cdc/entry/schema_storage_test.go
@@ -18,6 +18,7 @@ import (
 	"encoding/json"
 	"fmt"
 	"testing"
+	"time"
 
 	"github.com/pingcap/errors"
 	"github.com/pingcap/log"
@@ -26,7 +27,8 @@ import (
 	"github.com/pingcap/tidb/pkg/domain"
 	tidbkv "github.com/pingcap/tidb/pkg/kv"
 	timeta "github.com/pingcap/tidb/pkg/meta"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/session"
 	"github.com/pingcap/tidb/pkg/sessionctx"
@@ -45,7 +47,7 @@ import (
 )
 
 func TestSchema(t *testing.T) {
-	dbName := timodel.NewCIStr("Test")
+	dbName := pmodel.NewCIStr("Test")
 	// db and ignoreDB info
 	dbInfo := &timodel.DBInfo{
 		ID:    1,
@@ -113,10 +115,10 @@ func TestSchema(t *testing.T) {
 
 func TestTable(t *testing.T) {
 	var jobs []*timodel.Job
-	dbName := timodel.NewCIStr("Test")
-	tbName := timodel.NewCIStr("T")
-	colName := timodel.NewCIStr("A")
-	idxName := timodel.NewCIStr("idx")
+	dbName := pmodel.NewCIStr("Test")
+	tbName := pmodel.NewCIStr("T")
+	colName := pmodel.NewCIStr("A")
+	idxName := pmodel.NewCIStr("idx")
 	// column info
 	colInfo := &timodel.ColumnInfo{
 		ID:        1,
@@ -293,10 +295,10 @@ func TestTable(t *testing.T) {
 
 func TestHandleDDL(t *testing.T) {
 	snap := schema.NewEmptySnapshot(false)
-	dbName := timodel.NewCIStr("Test")
-	colName := timodel.NewCIStr("A")
-	tbName := timodel.NewCIStr("T")
-	newTbName := timodel.NewCIStr("RT")
+	dbName := pmodel.NewCIStr("Test")
+	colName := pmodel.NewCIStr("A")
+	tbName := pmodel.NewCIStr("T")
+	newTbName := pmodel.NewCIStr("RT")
 
 	// db info
 	dbInfo := &timodel.DBInfo{
@@ -398,7 +400,7 @@ func TestHandleRenameTables(t *testing.T) {
 	for i = 1; i < 3; i++ {
 		dbInfo := &timodel.DBInfo{
 			ID:    i,
-			Name:  timodel.NewCIStr(fmt.Sprintf("db_%d", i)),
+			Name:  pmodel.NewCIStr(fmt.Sprintf("db_%d", i)),
 			State: timodel.StatePublic,
 		}
 		job := &timodel.Job{
@@ -415,7 +417,7 @@ func TestHandleRenameTables(t *testing.T) {
 	for i = 1; i < 3; i++ {
 		tblInfo := &timodel.TableInfo{
 			ID:    10 + i,
-			Name:  timodel.NewCIStr(fmt.Sprintf("table_%d", i)),
+			Name:  pmodel.NewCIStr(fmt.Sprintf("table_%d", i)),
 			State: timodel.StatePublic,
 		}
 		job := &timodel.Job{
@@ -435,12 +437,14 @@ func TestHandleRenameTables(t *testing.T) {
 	oldSchemaIDs := []int64{1, 2}
 	newSchemaIDs := []int64{2, 1}
 	oldTableIDs := []int64{11, 12}
-	newTableNames := []timodel.CIStr{timodel.NewCIStr("x"), timodel.NewCIStr("y")}
-	oldSchemaNames := []timodel.CIStr{timodel.NewCIStr("db_1"), timodel.NewCIStr("db_2")}
-	args := []interface{}{oldSchemaIDs, newSchemaIDs, newTableNames, oldTableIDs, oldSchemaNames}
+	newTableNames := []pmodel.CIStr{pmodel.NewCIStr("x"), pmodel.NewCIStr("y")}
+	oldTableNames := []pmodel.CIStr{pmodel.NewCIStr("oldx"), pmodel.NewCIStr("oldy")}
+	oldSchemaNames := []pmodel.CIStr{pmodel.NewCIStr("db_1"), pmodel.NewCIStr("db_2")}
+	args := []interface{}{oldSchemaIDs, newSchemaIDs, newTableNames, oldTableIDs, oldSchemaNames, oldTableNames}
 	rawArgs, err := json.Marshal(args)
 	require.Nil(t, err)
-	var job *timodel.Job = &timodel.Job{
+	job := &timodel.Job{
+		Version: timodel.JobVersion1,
 		Type:    timodel.ActionRenameTables,
 		RawArgs: rawArgs,
 		BinlogInfo: &timodel.HistoryInfo{
@@ -450,13 +454,13 @@ func TestHandleRenameTables(t *testing.T) {
 	job.BinlogInfo.MultipleTableInfos = append(job.BinlogInfo.MultipleTableInfos,
 		&timodel.TableInfo{
 			ID:    13,
-			Name:  timodel.NewCIStr("x"),
+			Name:  pmodel.NewCIStr("x"),
 			State: timodel.StatePublic,
 		})
 	job.BinlogInfo.MultipleTableInfos = append(job.BinlogInfo.MultipleTableInfos,
 		&timodel.TableInfo{
 			ID:    14,
-			Name:  timodel.NewCIStr("y"),
+			Name:  pmodel.NewCIStr("y"),
 			State: timodel.StatePublic,
 		})
 	testDoDDLAndCheck(t, snap, job, false)
@@ -485,8 +489,8 @@ func testDoDDLAndCheck(t *testing.T, snap *schema.Snapshot, job *timodel.Job, is
 
 func TestMultiVersionStorage(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
-	dbName := timodel.NewCIStr("Test")
-	tbName := timodel.NewCIStr("T1")
+	dbName := pmodel.NewCIStr("Test")
+	tbName := pmodel.NewCIStr("T1")
 	// db and ignoreDB info
 	dbInfo := &timodel.DBInfo{
 		ID:    11,
@@ -525,7 +529,7 @@ func TestMultiVersionStorage(t *testing.T) {
 
 	jobs = append(jobs, job)
 
-	tbName = timodel.NewCIStr("T2")
+	tbName = pmodel.NewCIStr("T2")
 	// table info
 	tblInfo = &timodel.TableInfo{
 		ID:    13,
@@ -673,7 +677,7 @@ func TestCreateSnapFromMeta(t *testing.T) {
 	require.Nil(t, err)
 	defer store.Close() //nolint:errcheck
 
-	session.SetSchemaLease(0)
+	session.SetSchemaLease(time.Second)
 	session.DisableStats4Test()
 	domain, err := session.BootstrapSession(store)
 	require.Nil(t, err)
@@ -708,7 +712,7 @@ func TestExplicitTables(t *testing.T) {
 	require.Nil(t, err)
 	defer store.Close() //nolint:errcheck
 
-	session.SetSchemaLease(0)
+	session.SetSchemaLease(time.Second)
 	session.DisableStats4Test()
 	domain, err := session.BootstrapSession(store)
 	require.Nil(t, err)
@@ -859,7 +863,7 @@ func TestSchemaStorage(t *testing.T) {
 		ticonfig.UpdateGlobal(func(conf *ticonfig.Config) {
 			conf.AlterPrimaryKey = true
 		})
-		session.SetSchemaLease(0)
+		session.SetSchemaLease(time.Second)
 		session.DisableStats4Test()
 		domain, err := session.BootstrapSession(store)
 		require.Nil(t, err)
@@ -952,7 +956,7 @@ func TestHandleKey(t *testing.T) {
 	require.Nil(t, err)
 	defer store.Close() //nolint:errcheck
 
-	session.SetSchemaLease(0)
+	session.SetSchemaLease(time.Second)
 	session.DisableStats4Test()
 	domain, err := session.BootstrapSession(store)
 	require.Nil(t, err)
diff --git a/cdc/entry/schema_test.go b/cdc/entry/schema_test.go
index a7d3c8688..8fb0d68a1 100644
--- a/cdc/entry/schema_test.go
+++ b/cdc/entry/schema_test.go
@@ -20,7 +20,8 @@ import (
 	"sort"
 	"testing"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -138,7 +139,7 @@ func TestAllTables(t *testing.T) {
 	require.Equal(t, model.TableName{
 		Schema:  "test",
 		Table:   "t1",
-		TableID: 106,
+		TableID: 108,
 	}, tableName)
 	// add ineligible table
 	job = helper.DDL2Job("create table test.t2(id int)")
@@ -150,7 +151,7 @@ func TestAllTables(t *testing.T) {
 	require.Equal(t, model.TableName{
 		Schema:  "test",
 		Table:   "t1",
-		TableID: 106,
+		TableID: 108,
 	}, tableName)
 }
 
@@ -242,7 +243,7 @@ func TestBuildDDLEventsFromSingleTableDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
 				},
 			},
 		},
@@ -267,8 +268,8 @@ func TestBuildDDLEventsFromSingleTableDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
-					{Name: timodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeString)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+					{Name: pmodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeString)},
 				},
 			},
 		},
@@ -280,7 +281,7 @@ func TestBuildDDLEventsFromSingleTableDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
 				},
 			},
 		},
@@ -330,13 +331,13 @@ func TestBuildDDLEventsFromRenameTablesDDL(t *testing.T) {
 	oldSchemaIDs := []int64{schemaID, schemaID}
 	oldTableIDs := []int64{t1TableID, t2TableID}
 	newSchemaIDs := oldSchemaIDs
-	oldSchemaNames := []timodel.CIStr{
-		timodel.NewCIStr("test1"),
-		timodel.NewCIStr("test1"),
+	oldSchemaNames := []pmodel.CIStr{
+		pmodel.NewCIStr("test1"),
+		pmodel.NewCIStr("test1"),
 	}
-	newTableNames := []timodel.CIStr{
-		timodel.NewCIStr("t10"),
-		timodel.NewCIStr("t20"),
+	newTableNames := []pmodel.CIStr{
+		pmodel.NewCIStr("t10"),
+		pmodel.NewCIStr("t20"),
 	}
 	args := []interface{}{
 		oldSchemaIDs, newSchemaIDs,
@@ -366,7 +367,7 @@ func TestBuildDDLEventsFromRenameTablesDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
 				},
 			},
 		},
@@ -378,7 +379,7 @@ func TestBuildDDLEventsFromRenameTablesDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
 				},
 			},
 		},
@@ -396,7 +397,7 @@ func TestBuildDDLEventsFromRenameTablesDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
 				},
 			},
 		},
@@ -408,7 +409,7 @@ func TestBuildDDLEventsFromRenameTablesDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
 				},
 			},
 		},
@@ -464,7 +465,7 @@ func TestBuildDDLEventsFromDropTablesDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
 				},
 			},
 		},
@@ -476,7 +477,7 @@ func TestBuildDDLEventsFromDropTablesDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
 				},
 			},
 		},
@@ -499,7 +500,7 @@ func TestBuildDDLEventsFromDropTablesDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
 				},
 			},
 		},
@@ -511,7 +512,7 @@ func TestBuildDDLEventsFromDropTablesDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeLong)},
 				},
 			},
 		},
@@ -585,7 +586,7 @@ func TestBuildDDLEventsFromDropViewsDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeUnspecified)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeUnspecified)},
 				},
 			},
 		},
@@ -597,7 +598,7 @@ func TestBuildDDLEventsFromDropViewsDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeUnspecified)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeUnspecified)},
 				},
 			},
 		},
@@ -620,7 +621,7 @@ func TestBuildDDLEventsFromDropViewsDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeUnspecified)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeUnspecified)},
 				},
 			},
 		},
@@ -632,7 +633,7 @@ func TestBuildDDLEventsFromDropViewsDDL(t *testing.T) {
 			},
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
-					{Name: timodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeUnspecified)},
+					{Name: pmodel.NewCIStr("id"), FieldType: *types.NewFieldType(mysql.TypeUnspecified)},
 				},
 			},
 		},
diff --git a/cdc/entry/schema_test_helper.go b/cdc/entry/schema_test_helper.go
index fba513ba0..57cbc1c6e 100644
--- a/cdc/entry/schema_test_helper.go
+++ b/cdc/entry/schema_test_helper.go
@@ -25,7 +25,8 @@ import (
 	"github.com/pingcap/tidb/pkg/domain"
 	"github.com/pingcap/tidb/pkg/kv"
 	timeta "github.com/pingcap/tidb/pkg/meta"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/session"
 	"github.com/pingcap/tidb/pkg/store/mockstore"
 	"github.com/pingcap/tidb/pkg/testkit"
@@ -61,7 +62,7 @@ func NewSchemaTestHelperWithReplicaConfig(
 	ticonfig.UpdateGlobal(func(conf *ticonfig.Config) {
 		conf.AlterPrimaryKey = true
 	})
-	session.SetSchemaLease(0)
+	session.SetSchemaLease(time.Second)
 	session.DisableStats4Test()
 	domain, err := session.BootstrapSession(store)
 	require.NoError(t, err)
@@ -134,13 +135,13 @@ func (s *SchemaTestHelper) DDL2Job(ddl string) *timodel.Job {
 	for i := 0; i < tableNum; i++ {
 		oldTableIDs[i] = res.BinlogInfo.MultipleTableInfos[i].ID
 	}
-	newTableNames := make([]timodel.CIStr, tableNum)
+	newTableNames := make([]pmodel.CIStr, tableNum)
 	for i := 0; i < tableNum; i++ {
 		newTableNames[i] = res.BinlogInfo.MultipleTableInfos[i].Name
 	}
-	oldSchemaNames := make([]timodel.CIStr, tableNum)
+	oldSchemaNames := make([]pmodel.CIStr, tableNum)
 	for i := 0; i < tableNum; i++ {
-		oldSchemaNames[i] = timodel.NewCIStr(schema)
+		oldSchemaNames[i] = pmodel.NewCIStr(schema)
 	}
 	newSchemaIDs := oldSchemaIDs
 
@@ -241,13 +242,13 @@ func (s *SchemaTestHelper) DDL2Event(ddl string) *model.DDLEvent {
 		for i := 0; i < tableNum; i++ {
 			oldTableIDs[i] = res.BinlogInfo.MultipleTableInfos[i].ID
 		}
-		newTableNames := make([]timodel.CIStr, tableNum)
+		newTableNames := make([]pmodel.CIStr, tableNum)
 		for i := 0; i < tableNum; i++ {
 			newTableNames[i] = res.BinlogInfo.MultipleTableInfos[i].Name
 		}
-		oldSchemaNames := make([]timodel.CIStr, tableNum)
+		oldSchemaNames := make([]pmodel.CIStr, tableNum)
 		for i := 0; i < tableNum; i++ {
-			oldSchemaNames[i] = timodel.NewCIStr(schema)
+			oldSchemaNames[i] = pmodel.NewCIStr(schema)
 		}
 		newSchemaIDs := oldSchemaIDs
 
diff --git a/cdc/model/codec/codec_test.go b/cdc/model/codec/codec_test.go
index 03577cbcd..198599210 100644
--- a/cdc/model/codec/codec_test.go
+++ b/cdc/model/codec/codec_test.go
@@ -16,8 +16,8 @@ package codec
 import (
 	"testing"
 
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/charset"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tiflow/cdc/model"
 	codecv1 "github.com/pingcap/tiflow/cdc/model/codec/v1"
diff --git a/cdc/model/codec/v1/convert_test.go b/cdc/model/codec/v1/convert_test.go
index 75a5d3ede..1460b598c 100644
--- a/cdc/model/codec/v1/convert_test.go
+++ b/cdc/model/codec/v1/convert_test.go
@@ -16,8 +16,8 @@ package v1
 import (
 	"testing"
 
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/charset"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/stretchr/testify/require"
diff --git a/cdc/model/schema_storage_test.go b/cdc/model/schema_storage_test.go
index 30ce816cc..7342f68d3 100644
--- a/cdc/model/schema_storage_test.go
+++ b/cdc/model/schema_storage_test.go
@@ -16,8 +16,9 @@ package model
 import (
 	"testing"
 
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/charset"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	parser_types "github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/stretchr/testify/require"
@@ -34,22 +35,22 @@ func TestHandleKeyPriority(t *testing.T) {
 	tbl := timodel.TableInfo{
 		Columns: []*timodel.ColumnInfo{
 			{
-				Name:      timodel.CIStr{O: "a"},
+				Name:      pmodel.CIStr{O: "a"},
 				FieldType: *ftNotNull,
 				State:     timodel.StatePublic,
 			},
 			{
-				Name:      timodel.CIStr{O: "b"},
+				Name:      pmodel.CIStr{O: "b"},
 				FieldType: *ftNotNull,
 				State:     timodel.StatePublic,
 			},
 			{
-				Name:      timodel.CIStr{O: "c"},
+				Name:      pmodel.CIStr{O: "c"},
 				FieldType: *ftNotNull,
 				State:     timodel.StatePublic,
 			},
 			{
-				Name:      timodel.CIStr{O: "d"},
+				Name:      pmodel.CIStr{O: "d"},
 				FieldType: parser_types.FieldType{
 					// test not null unique index
 					// Flag: mysql.NotNullFlag,
@@ -57,7 +58,7 @@ func TestHandleKeyPriority(t *testing.T) {
 				State: timodel.StatePublic,
 			},
 			{
-				Name:      timodel.CIStr{O: "e"},
+				Name:      pmodel.CIStr{O: "e"},
 				FieldType: *ftNull,
 				State:     timodel.StatePublic,
 				// test virtual generated column is not treated as unique key
@@ -68,52 +69,52 @@ func TestHandleKeyPriority(t *testing.T) {
 		Indices: []*timodel.IndexInfo{
 			{
 				ID: 10,
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "a,b",
 				},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "a"}, Offset: 0},
-					{Name: timodel.CIStr{O: "b"}, Offset: 1},
+					{Name: pmodel.CIStr{O: "a"}, Offset: 0},
+					{Name: pmodel.CIStr{O: "b"}, Offset: 1},
 				},
 				Unique: true,
 			},
 			{
 				ID: 9,
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "c",
 				},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "c"}, Offset: 2},
+					{Name: pmodel.CIStr{O: "c"}, Offset: 2},
 				},
 				Unique: true,
 			},
 			{
 				ID: 8,
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "b",
 				},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "b"}, Offset: 1},
+					{Name: pmodel.CIStr{O: "b"}, Offset: 1},
 				},
 				Unique: true,
 			},
 			{
 				ID: 7,
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "d",
 				},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "d"}, Offset: 3},
+					{Name: pmodel.CIStr{O: "d"}, Offset: 3},
 				},
 				Unique: true,
 			},
 			{
 				ID: 6,
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "e",
 				},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "e"}, Offset: 4},
+					{Name: pmodel.CIStr{O: "e"}, Offset: 4},
 				},
 				Unique: true,
 			},
@@ -140,23 +141,23 @@ func TestTableInfoGetterFuncs(t *testing.T) {
 
 	tbl := timodel.TableInfo{
 		ID:   1071,
-		Name: timodel.CIStr{O: "t1"},
+		Name: pmodel.CIStr{O: "t1"},
 		Columns: []*timodel.ColumnInfo{
 			{
 				ID:        0,
-				Name:      timodel.CIStr{O: "a"},
+				Name:      pmodel.CIStr{O: "a"},
 				FieldType: *ftNotNullBinCharset,
 				State:     timodel.StatePublic,
 			},
 			{
 				ID:        1,
-				Name:      timodel.CIStr{O: "b"},
+				Name:      pmodel.CIStr{O: "b"},
 				FieldType: *ftNotNull,
 				State:     timodel.StatePublic,
 			},
 			{
 				ID:        2,
-				Name:      timodel.CIStr{O: "c"},
+				Name:      pmodel.CIStr{O: "c"},
 				FieldType: *ftNull,
 				State:     timodel.StatePublic,
 			},
@@ -164,11 +165,11 @@ func TestTableInfoGetterFuncs(t *testing.T) {
 		Indices: []*timodel.IndexInfo{
 			{
 				ID: 0,
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "c",
 				},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "c"}, Offset: 2},
+					{Name: pmodel.CIStr{O: "c"}, Offset: 2},
 				},
 				Unique: true,
 			},
@@ -204,11 +205,11 @@ func TestTableInfoGetterFuncs(t *testing.T) {
 	require.True(t, info.IsEligible(false))
 	tbl = timodel.TableInfo{
 		ID:   1073,
-		Name: timodel.CIStr{O: "t2"},
+		Name: pmodel.CIStr{O: "t2"},
 		Columns: []*timodel.ColumnInfo{
 			{
 				ID:        0,
-				Name:      timodel.CIStr{O: "a"},
+				Name:      pmodel.CIStr{O: "a"},
 				FieldType: parser_types.FieldType{},
 				State:     timodel.StatePublic,
 			},
@@ -216,9 +217,9 @@ func TestTableInfoGetterFuncs(t *testing.T) {
 		Indices: []*timodel.IndexInfo{
 			{
 				ID:   0,
-				Name: timodel.CIStr{O: "a"},
+				Name: pmodel.CIStr{O: "a"},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "a"}, Offset: 0},
+					{Name: pmodel.CIStr{O: "a"}, Offset: 0},
 				},
 				Unique: true,
 			},
@@ -250,11 +251,11 @@ func TestTableInfoClone(t *testing.T) {
 	ft.SetFlag(mysql.NotNullFlag)
 	tbl := timodel.TableInfo{
 		ID:   1071,
-		Name: timodel.CIStr{O: "t1"},
+		Name: pmodel.CIStr{O: "t1"},
 		Columns: []*timodel.ColumnInfo{
 			{
 				ID:        0,
-				Name:      timodel.CIStr{O: "c"},
+				Name:      pmodel.CIStr{O: "c"},
 				FieldType: *ft,
 				State:     timodel.StatePublic,
 			},
@@ -262,11 +263,11 @@ func TestTableInfoClone(t *testing.T) {
 		Indices: []*timodel.IndexInfo{
 			{
 				ID: 0,
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "c",
 				},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "c"}, Offset: 0},
+					{Name: pmodel.CIStr{O: "c"}, Offset: 0},
 				},
 				Unique: true,
 			},
@@ -294,12 +295,12 @@ func TestIndexByName(t *testing.T) {
 		TableInfo: &timodel.TableInfo{
 			Indices: []*timodel.IndexInfo{
 				{
-					Name: timodel.CIStr{
+					Name: pmodel.CIStr{
 						O: "idx1",
 					},
 					Columns: []*timodel.IndexColumn{
 						{
-							Name: timodel.CIStr{
+							Name: pmodel.CIStr{
 								O: "col1",
 							},
 						},
@@ -325,19 +326,19 @@ func TestColumnsByNames(t *testing.T) {
 		TableInfo: &timodel.TableInfo{
 			Columns: []*timodel.ColumnInfo{
 				{
-					Name: timodel.CIStr{
+					Name: pmodel.CIStr{
 						O: "col2",
 					},
 					Offset: 1,
 				},
 				{
-					Name: timodel.CIStr{
+					Name: pmodel.CIStr{
 						O: "col1",
 					},
 					Offset: 0,
 				},
 				{
-					Name: timodel.CIStr{
+					Name: pmodel.CIStr{
 						O: "col3",
 					},
 					Offset: 2,
@@ -518,24 +519,24 @@ func TestBuildTiDBTableInfoWithoutVirtualColumns(t *testing.T) {
 	tableInfo := timodel.TableInfo{
 		Columns: []*timodel.ColumnInfo{
 			{
-				Name:      timodel.CIStr{O: "a"},
+				Name:      pmodel.CIStr{O: "a"},
 				FieldType: *ftNotNull,
 				State:     timodel.StatePublic,
 			},
 			{
-				Name:      timodel.CIStr{O: "b"},
+				Name:      pmodel.CIStr{O: "b"},
 				FieldType: *ftNotNull,
 				State:     timodel.StatePublic,
 			},
 			{
-				Name:                timodel.CIStr{O: "c"},
+				Name:                pmodel.CIStr{O: "c"},
 				FieldType:           *ftNull,
 				State:               timodel.StatePublic,
 				GeneratedExprString: "as d",
 				GeneratedStored:     false,
 			},
 			{
-				Name:      timodel.CIStr{O: "d"},
+				Name:      pmodel.CIStr{O: "d"},
 				FieldType: *ftNotNull,
 				State:     timodel.StatePublic,
 			},
@@ -543,42 +544,42 @@ func TestBuildTiDBTableInfoWithoutVirtualColumns(t *testing.T) {
 		Indices: []*timodel.IndexInfo{
 			{
 				ID: 10,
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "a,b",
 				},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "a"}, Offset: 0},
-					{Name: timodel.CIStr{O: "b"}, Offset: 1},
+					{Name: pmodel.CIStr{O: "a"}, Offset: 0},
+					{Name: pmodel.CIStr{O: "b"}, Offset: 1},
 				},
 				Unique: true,
 			},
 			{
 				ID: 9,
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "c",
 				},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "c"}, Offset: 2},
+					{Name: pmodel.CIStr{O: "c"}, Offset: 2},
 				},
 				Unique: true,
 			},
 			{
 				ID: 8,
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "b",
 				},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "b"}, Offset: 1},
+					{Name: pmodel.CIStr{O: "b"}, Offset: 1},
 				},
 				Unique: true,
 			},
 			{
 				ID: 7,
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "d",
 				},
 				Columns: []*timodel.IndexColumn{
-					{Name: timodel.CIStr{O: "d"}, Offset: 3},
+					{Name: pmodel.CIStr{O: "d"}, Offset: 3},
 				},
 				Unique: true,
 			},
diff --git a/cdc/model/sink_test.go b/cdc/model/sink_test.go
index f77e0f2df..49761869d 100644
--- a/cdc/model/sink_test.go
+++ b/cdc/model/sink_test.go
@@ -17,7 +17,8 @@ import (
 	"sort"
 	"testing"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tiflow/pkg/sink"
@@ -152,10 +153,10 @@ func TestDDLEventFromJob(t *testing.T) {
 		BinlogInfo: &timodel.HistoryInfo{
 			TableInfo: &timodel.TableInfo{
 				ID:   49,
-				Name: timodel.CIStr{O: "t1"},
+				Name: pmodel.CIStr{O: "t1"},
 				Columns: []*timodel.ColumnInfo{
-					{ID: 1, Name: timodel.CIStr{O: "id"}, FieldType: *ft, State: timodel.StatePublic},
-					{ID: 2, Name: timodel.CIStr{O: "a"}, FieldType: types.FieldType{}, State: timodel.StatePublic},
+					{ID: 1, Name: pmodel.CIStr{O: "id"}, FieldType: *ft, State: timodel.StatePublic},
+					{ID: 2, Name: pmodel.CIStr{O: "a"}, FieldType: types.FieldType{}, State: timodel.StatePublic},
 				},
 			},
 			FinishedTS: 420536581196873729,
@@ -169,9 +170,9 @@ func TestDDLEventFromJob(t *testing.T) {
 		},
 		TableInfo: &timodel.TableInfo{
 			ID:   49,
-			Name: timodel.CIStr{O: "t1"},
+			Name: pmodel.CIStr{O: "t1"},
 			Columns: []*timodel.ColumnInfo{
-				{ID: 1, Name: timodel.CIStr{O: "id"}, FieldType: *ft, State: timodel.StatePublic},
+				{ID: 1, Name: pmodel.CIStr{O: "id"}, FieldType: *ft, State: timodel.StatePublic},
 			},
 		},
 	}
@@ -202,11 +203,11 @@ func TestRenameTables(t *testing.T) {
 			MultipleTableInfos: []*timodel.TableInfo{
 				{
 					ID:   67,
-					Name: timodel.CIStr{O: "t10"},
+					Name: pmodel.CIStr{O: "t10"},
 					Columns: []*timodel.ColumnInfo{
 						{
 							ID:        1,
-							Name:      timodel.CIStr{O: "id"},
+							Name:      pmodel.CIStr{O: "id"},
 							FieldType: *ft,
 							State:     timodel.StatePublic,
 						},
@@ -214,11 +215,11 @@ func TestRenameTables(t *testing.T) {
 				},
 				{
 					ID:   69,
-					Name: timodel.CIStr{O: "t20"},
+					Name: pmodel.CIStr{O: "t20"},
 					Columns: []*timodel.ColumnInfo{
 						{
 							ID:        1,
-							Name:      timodel.CIStr{O: "id"},
+							Name:      pmodel.CIStr{O: "id"},
 							FieldType: *ft,
 							State:     timodel.StatePublic,
 						},
@@ -236,11 +237,11 @@ func TestRenameTables(t *testing.T) {
 		},
 		TableInfo: &timodel.TableInfo{
 			ID:   67,
-			Name: timodel.CIStr{O: "t1"},
+			Name: pmodel.CIStr{O: "t1"},
 			Columns: []*timodel.ColumnInfo{
 				{
 					ID:        1,
-					Name:      timodel.CIStr{O: "id"},
+					Name:      pmodel.CIStr{O: "id"},
 					FieldType: *ft,
 					State:     timodel.StatePublic,
 				},
@@ -256,11 +257,11 @@ func TestRenameTables(t *testing.T) {
 		},
 		TableInfo: &timodel.TableInfo{
 			ID:   67,
-			Name: timodel.CIStr{O: "t10"},
+			Name: pmodel.CIStr{O: "t10"},
 			Columns: []*timodel.ColumnInfo{
 				{
 					ID:        1,
-					Name:      timodel.CIStr{O: "id"},
+					Name:      pmodel.CIStr{O: "id"},
 					FieldType: *ft,
 					State:     timodel.StatePublic,
 				},
@@ -287,11 +288,11 @@ func TestRenameTables(t *testing.T) {
 		},
 		TableInfo: &timodel.TableInfo{
 			ID:   69,
-			Name: timodel.CIStr{O: "t2"},
+			Name: pmodel.CIStr{O: "t2"},
 			Columns: []*timodel.ColumnInfo{
 				{
 					ID:        1,
-					Name:      timodel.CIStr{O: "id"},
+					Name:      pmodel.CIStr{O: "id"},
 					FieldType: *ft,
 					State:     timodel.StatePublic,
 				},
@@ -307,11 +308,11 @@ func TestRenameTables(t *testing.T) {
 		},
 		TableInfo: &timodel.TableInfo{
 			ID:   69,
-			Name: timodel.CIStr{O: "t20"},
+			Name: pmodel.CIStr{O: "t20"},
 			Columns: []*timodel.ColumnInfo{
 				{
 					ID:        1,
-					Name:      timodel.CIStr{O: "id"},
+					Name:      pmodel.CIStr{O: "id"},
 					FieldType: *ft,
 					State:     timodel.StatePublic,
 				},
@@ -355,11 +356,11 @@ func TestExchangeTablePartition(t *testing.T) {
 		},
 		TableInfo: &timodel.TableInfo{
 			ID:   67,
-			Name: timodel.CIStr{O: "t1"},
+			Name: pmodel.CIStr{O: "t1"},
 			Columns: []*timodel.ColumnInfo{
 				{
 					ID:        1,
-					Name:      timodel.CIStr{O: "id"},
+					Name:      pmodel.CIStr{O: "id"},
 					FieldType: *ft,
 					State:     timodel.StatePublic,
 				},
@@ -376,11 +377,11 @@ func TestExchangeTablePartition(t *testing.T) {
 		},
 		TableInfo: &timodel.TableInfo{
 			ID:   69,
-			Name: timodel.CIStr{O: "t10"},
+			Name: pmodel.CIStr{O: "t10"},
 			Columns: []*timodel.ColumnInfo{
 				{
 					ID:        1,
-					Name:      timodel.CIStr{O: "id"},
+					Name:      pmodel.CIStr{O: "id"},
 					FieldType: *ft,
 					State:     timodel.StatePublic,
 				},
diff --git a/cdc/owner/changefeed_test.go b/cdc/owner/changefeed_test.go
index ed85470d5..4db8a77b1 100644
--- a/cdc/owner/changefeed_test.go
+++ b/cdc/owner/changefeed_test.go
@@ -23,7 +23,7 @@ import (
 	"time"
 
 	"github.com/pingcap/errors"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/entry"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/cdc/puller"
diff --git a/cdc/owner/ddl_manager_test.go b/cdc/owner/ddl_manager_test.go
index 75757179c..bbb413e99 100644
--- a/cdc/owner/ddl_manager_test.go
+++ b/cdc/owner/ddl_manager_test.go
@@ -20,7 +20,8 @@ import (
 	"testing"
 	"time"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tiflow/cdc/entry"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/cdc/redo"
@@ -69,7 +70,7 @@ func newFakeDDLEvent(
 	}
 	info.TableInfo = &timodel.TableInfo{
 		ID:   tableID,
-		Name: timodel.NewCIStr(tableName),
+		Name: pmodel.NewCIStr(tableName),
 	}
 	return &model.DDLEvent{
 		TableInfo: info,
@@ -172,7 +173,7 @@ func TestExecRenameTablesDDL(t *testing.T) {
 	mockDDLSink := dm.ddlSink.(*mockDDLSink)
 
 	var oldSchemaIDs, newSchemaIDs, oldTableIDs []int64
-	var newTableNames, oldSchemaNames []timodel.CIStr
+	var newTableNames, oldSchemaNames []pmodel.CIStr
 
 	execCreateStmt := func(tp, actualDDL, expectedDDL string) {
 		mockDDLSink.ddlDone = false
@@ -214,20 +215,24 @@ func TestExecRenameTablesDDL(t *testing.T) {
 	require.Len(t, oldSchemaIDs, 2)
 	require.Len(t, oldTableIDs, 2)
 	newSchemaIDs = []int64{oldSchemaIDs[1], oldSchemaIDs[0]}
-	oldSchemaNames = []timodel.CIStr{
-		timodel.NewCIStr("test1"),
-		timodel.NewCIStr("test2"),
+	oldSchemaNames = []pmodel.CIStr{
+		pmodel.NewCIStr("test1"),
+		pmodel.NewCIStr("test2"),
 	}
-	newTableNames = []timodel.CIStr{
-		timodel.NewCIStr("tb20"),
-		timodel.NewCIStr("tb10"),
+	newTableNames = []pmodel.CIStr{
+		pmodel.NewCIStr("tb20"),
+		pmodel.NewCIStr("tb10"),
+	}
+	oldTableNames := []pmodel.CIStr{
+		pmodel.NewCIStr("oldtb20"),
+		pmodel.NewCIStr("oldtb10"),
 	}
 	require.Len(t, newSchemaIDs, 2)
 	require.Len(t, oldSchemaNames, 2)
 	require.Len(t, newTableNames, 2)
 	args := []interface{}{
 		oldSchemaIDs, newSchemaIDs, newTableNames,
-		oldTableIDs, oldSchemaNames,
+		oldTableIDs, oldSchemaNames, oldTableNames,
 	}
 	rawArgs, err := json.Marshal(args)
 	require.Nil(t, err)
@@ -236,6 +241,8 @@ func TestExecRenameTablesDDL(t *testing.T) {
 	// the RawArgs field in job fetched from tidb snapshot meta is incorrent,
 	// so we manually construct `job.RawArgs` to do the workaround.
 	job.RawArgs = rawArgs
+	// TODO REMOVE IT AFTER use args v2 decoder function
+	job.Version = timodel.JobVersion1
 
 	mockDDLSink.recordDDLHistory = true
 	mockDDLSink.ddlDone = false
diff --git a/cdc/puller/ddl_puller_test.go b/cdc/puller/ddl_puller_test.go
index d34422d0f..63a25dee4 100644
--- a/cdc/puller/ddl_puller_test.go
+++ b/cdc/puller/ddl_puller_test.go
@@ -22,7 +22,7 @@ import (
 
 	"github.com/pingcap/errors"
 	"github.com/pingcap/log"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/sessionctx/variable"
 	"github.com/pingcap/tidb/pkg/util/codec"
 	"github.com/pingcap/tiflow/cdc/entry"
@@ -198,7 +198,8 @@ func TestHandleRenameTable(t *testing.T) {
 		waitResolvedTs(t, ddlJobPuller, job.BinlogInfo.FinishedTS+1)
 
 		job = helper.DDL2Job("rename table test1.t1 to test1.t11, test1.t3 to test1.t33, test1.t5 to test1.t55, ignore1.a to ignore1.b")
-
+		// TODO REMOVE IT AFTER use args v2 decoder function
+		job.Version = timodel.JobVersion1
 		skip, err := ddlJobPullerImpl.handleRenameTables(job)
 		require.NoError(t, err)
 		require.False(t, skip)
@@ -209,6 +210,8 @@ func TestHandleRenameTable(t *testing.T) {
 	{
 		_ = helper.DDL2Job("create table test1.t6(id int primary key)")
 		job := helper.DDL2Job("rename table test1.t2 to test1.t22, test1.t6 to test1.t66")
+		// TODO REMOVE IT AFTER use args v2 decoder function
+		job.Version = timodel.JobVersion1
 		skip, err := ddlJobPullerImpl.handleRenameTables(job)
 		require.Error(t, err)
 		require.True(t, skip)
@@ -240,6 +243,8 @@ func TestHandleRenameTable(t *testing.T) {
 		waitResolvedTs(t, ddlJobPuller, job.BinlogInfo.FinishedTS+1)
 
 		job = helper.DDL2Job("rename table test2.t1 to test2.t11, test2.t2 to test2.t22, test2.t3 to test2.t33")
+		// TODO REMOVE IT AFTER use args v2 decoder function
+		job.Version = timodel.JobVersion1
 		skip, err := ddlJobPullerImpl.handleRenameTables(job)
 		require.NoError(t, err)
 		require.True(t, skip)
@@ -264,6 +269,8 @@ func TestHandleRenameTable(t *testing.T) {
 		waitResolvedTs(t, ddlJobPuller, job.BinlogInfo.FinishedTS+1)
 
 		job = helper.DDL2Job("rename table Test3.t1 to Test3.t11, Test3.t2 to Test3.t22")
+		// TODO REMOVE IT AFTER use args v2 decoder function
+		job.Version = timodel.JobVersion1
 		skip, err := ddlJobPullerImpl.handleRenameTables(job)
 		require.NoError(t, err)
 		require.False(t, skip)
@@ -336,6 +343,8 @@ func TestHandleRenameTable(t *testing.T) {
 		// but now it will throw an error since schema ignore1 are not in schemaStorage
 		// ref: https://github.com/pingcap/tiflow/issues/9488
 		job = helper.DDL2Job("rename table test1.t202308081 to ignore1.ignore1, test1.t202308082 to ignore1.dongmen")
+		// TODO REMOVE IT AFTER use args v2 decoder function
+		job.Version = timodel.JobVersion1
 		_, err = ddlJobPullerImpl.handleJob(job)
 		require.NotNil(t, err)
 		require.Contains(t, err.Error(), "ErrSnapshotSchemaNotFound")
diff --git a/cdc/sink/ddlsink/cloudstorage/cloud_storage_ddl_sink_test.go b/cdc/sink/ddlsink/cloudstorage/cloud_storage_ddl_sink_test.go
index 0c2e5bdf7..24fd8f2df 100644
--- a/cdc/sink/ddlsink/cloudstorage/cloud_storage_ddl_sink_test.go
+++ b/cdc/sink/ddlsink/cloudstorage/cloud_storage_ddl_sink_test.go
@@ -23,7 +23,8 @@ import (
 	"testing"
 	"time"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -59,11 +60,11 @@ func TestWriteDDLEvent(t *testing.T) {
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
 					{
-						Name:      timodel.NewCIStr("col1"),
+						Name:      pmodel.NewCIStr("col1"),
 						FieldType: *types.NewFieldType(mysql.TypeLong),
 					},
 					{
-						Name:      timodel.NewCIStr("col2"),
+						Name:      pmodel.NewCIStr("col2"),
 						FieldType: *types.NewFieldType(mysql.TypeVarchar),
 					},
 				},
@@ -122,11 +123,11 @@ func TestWriteCheckpointTs(t *testing.T) {
 			TableInfo: &timodel.TableInfo{
 				Columns: []*timodel.ColumnInfo{
 					{
-						Name:      timodel.NewCIStr("col1"),
+						Name:      pmodel.NewCIStr("col1"),
 						FieldType: *types.NewFieldType(mysql.TypeLong),
 					},
 					{
-						Name:      timodel.NewCIStr("col2"),
+						Name:      pmodel.NewCIStr("col2"),
 						FieldType: *types.NewFieldType(mysql.TypeVarchar),
 					},
 				},
diff --git a/cdc/sink/ddlsink/mq/mq_ddl_sink_test.go b/cdc/sink/ddlsink/mq/mq_ddl_sink_test.go
index bd7eeb182..fb341c638 100644
--- a/cdc/sink/ddlsink/mq/mq_ddl_sink_test.go
+++ b/cdc/sink/ddlsink/mq/mq_ddl_sink_test.go
@@ -19,7 +19,7 @@ import (
 	"net/url"
 	"testing"
 
-	mm "github.com/pingcap/tidb/pkg/parser/model"
+	mm "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/cdc/sink/ddlsink/mq/ddlproducer"
 	"github.com/pingcap/tiflow/pkg/config"
diff --git a/cdc/sink/ddlsink/mq/pulsar_ddl_sink_test.go b/cdc/sink/ddlsink/mq/pulsar_ddl_sink_test.go
index 6cf312583..d06086f76 100644
--- a/cdc/sink/ddlsink/mq/pulsar_ddl_sink_test.go
+++ b/cdc/sink/ddlsink/mq/pulsar_ddl_sink_test.go
@@ -20,7 +20,7 @@ import (
 	"testing"
 
 	"github.com/aws/aws-sdk-go/aws"
-	mm "github.com/pingcap/tidb/pkg/parser/model"
+	mm "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/cdc/sink/ddlsink/mq/ddlproducer"
 	"github.com/pingcap/tiflow/cdc/sink/dmlsink/mq/manager"
diff --git a/cdc/sink/ddlsink/mysql/async_ddl_test.go b/cdc/sink/ddlsink/mysql/async_ddl_test.go
index b05f09bb9..3b302dff1 100644
--- a/cdc/sink/ddlsink/mysql/async_ddl_test.go
+++ b/cdc/sink/ddlsink/mysql/async_ddl_test.go
@@ -24,7 +24,7 @@ import (
 
 	"github.com/DATA-DOG/go-sqlmock"
 	dmysql "github.com/go-sql-driver/mysql"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/pkg/config"
 	pmysql "github.com/pingcap/tiflow/pkg/sink/mysql"
diff --git a/cdc/sink/ddlsink/mysql/mysql_ddl_sink_test.go b/cdc/sink/ddlsink/mysql/mysql_ddl_sink_test.go
index 43936af14..9ac024c3c 100644
--- a/cdc/sink/ddlsink/mysql/mysql_ddl_sink_test.go
+++ b/cdc/sink/ddlsink/mysql/mysql_ddl_sink_test.go
@@ -22,7 +22,7 @@ import (
 	"github.com/DATA-DOG/go-sqlmock"
 	dmysql "github.com/go-sql-driver/mysql"
 	"github.com/pingcap/tidb/pkg/infoschema"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/pkg/config"
 	pmysql "github.com/pingcap/tiflow/pkg/sink/mysql"
diff --git a/cdc/sink/dmlsink/cloudstorage/cloud_storage_dml_sink_test.go b/cdc/sink/dmlsink/cloudstorage/cloud_storage_dml_sink_test.go
index 953bb0789..d62148a4e 100644
--- a/cdc/sink/dmlsink/cloudstorage/cloud_storage_dml_sink_test.go
+++ b/cdc/sink/dmlsink/cloudstorage/cloud_storage_dml_sink_test.go
@@ -23,7 +23,8 @@ import (
 	"time"
 
 	"github.com/pingcap/failpoint"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -80,8 +81,8 @@ func generateTxnEvents(
 					Version: 33,
 					TableInfo: &timodel.TableInfo{
 						Columns: []*timodel.ColumnInfo{
-							{ID: 1, Name: timodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
-							{ID: 2, Name: timodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeVarchar)},
+							{ID: 1, Name: pmodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+							{ID: 2, Name: pmodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeVarchar)},
 						},
 					},
 				},
@@ -92,10 +93,10 @@ func generateTxnEvents(
 			SinkState: tableStatus,
 		}
 		tidbTableInfo := &timodel.TableInfo{
-			Name: timodel.NewCIStr("table1"),
+			Name: pmodel.NewCIStr("table1"),
 			Columns: []*timodel.ColumnInfo{
-				{ID: 1, Name: timodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
-				{ID: 2, Name: timodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeVarchar)},
+				{ID: 1, Name: pmodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+				{ID: 2, Name: pmodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeVarchar)},
 			},
 		}
 		tableInfo := model.WrapTableInfo(100, "test", 33, tidbTableInfo)
diff --git a/cdc/sink/dmlsink/cloudstorage/defragmenter_test.go b/cdc/sink/dmlsink/cloudstorage/defragmenter_test.go
index d1f180b4b..b6ea7da97 100644
--- a/cdc/sink/dmlsink/cloudstorage/defragmenter_test.go
+++ b/cdc/sink/dmlsink/cloudstorage/defragmenter_test.go
@@ -20,7 +20,8 @@ import (
 	"testing"
 	"time"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -70,10 +71,10 @@ func TestDeframenter(t *testing.T) {
 
 	tidbTableInfo := &timodel.TableInfo{
 		ID:   100,
-		Name: timodel.NewCIStr("table1"),
+		Name: pmodel.NewCIStr("table1"),
 		Columns: []*timodel.ColumnInfo{
-			{ID: 1, Name: timodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
-			{ID: 2, Name: timodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeString)},
+			{ID: 1, Name: pmodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+			{ID: 2, Name: pmodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeString)},
 		},
 	}
 	tableInfo := model.WrapTableInfo(100, "test", 99, tidbTableInfo)
diff --git a/cdc/sink/dmlsink/cloudstorage/dml_worker_test.go b/cdc/sink/dmlsink/cloudstorage/dml_worker_test.go
index 1815ed693..879581f54 100644
--- a/cdc/sink/dmlsink/cloudstorage/dml_worker_test.go
+++ b/cdc/sink/dmlsink/cloudstorage/dml_worker_test.go
@@ -21,7 +21,8 @@ import (
 	"testing"
 	"time"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -74,10 +75,10 @@ func TestDMLWorkerRun(t *testing.T) {
 	}
 	tidbTableInfo := &timodel.TableInfo{
 		ID:   100,
-		Name: timodel.NewCIStr("table1"),
+		Name: pmodel.NewCIStr("table1"),
 		Columns: []*timodel.ColumnInfo{
-			{ID: 1, Name: timodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
-			{ID: 2, Name: timodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeVarchar)},
+			{ID: 1, Name: pmodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+			{ID: 2, Name: pmodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeVarchar)},
 		},
 	}
 	tableInfo := model.WrapTableInfo(100, "test", 99, tidbTableInfo)
diff --git a/cdc/sink/dmlsink/cloudstorage/encoding_worker_test.go b/cdc/sink/dmlsink/cloudstorage/encoding_worker_test.go
index 618e1bd02..84e1aa688 100644
--- a/cdc/sink/dmlsink/cloudstorage/encoding_worker_test.go
+++ b/cdc/sink/dmlsink/cloudstorage/encoding_worker_test.go
@@ -19,7 +19,8 @@ import (
 	"sync"
 	"testing"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -67,10 +68,10 @@ func TestEncodeEvents(t *testing.T) {
 
 	tidbTableInfo := &timodel.TableInfo{
 		ID:   100,
-		Name: timodel.NewCIStr("table1"),
+		Name: pmodel.NewCIStr("table1"),
 		Columns: []*timodel.ColumnInfo{
-			{ID: 1, Name: timodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
-			{ID: 2, Name: timodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeString)},
+			{ID: 1, Name: pmodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+			{ID: 2, Name: pmodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeString)},
 		},
 	}
 	tableInfo := model.WrapTableInfo(100, "test", 33, tidbTableInfo)
@@ -132,10 +133,10 @@ func TestEncodingWorkerRun(t *testing.T) {
 	}
 	tidbTableInfo := &timodel.TableInfo{
 		ID:   100,
-		Name: timodel.NewCIStr("table1"),
+		Name: pmodel.NewCIStr("table1"),
 		Columns: []*timodel.ColumnInfo{
-			{ID: 1, Name: timodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
-			{ID: 2, Name: timodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeVarchar)},
+			{ID: 1, Name: pmodel.NewCIStr("c1"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+			{ID: 2, Name: pmodel.NewCIStr("c2"), FieldType: *types.NewFieldType(mysql.TypeVarchar)},
 		},
 	}
 	tableInfo := model.WrapTableInfo(100, "test", 33, tidbTableInfo)
diff --git a/cdc/sink/dmlsink/mq/dispatcher/event_router_test.go b/cdc/sink/dmlsink/mq/dispatcher/event_router_test.go
index 44fffc059..ba37604c1 100644
--- a/cdc/sink/dmlsink/mq/dispatcher/event_router_test.go
+++ b/cdc/sink/dmlsink/mq/dispatcher/event_router_test.go
@@ -16,7 +16,7 @@ package dispatcher
 import (
 	"testing"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/cdc/sink/dmlsink/mq/dispatcher/partition"
 	"github.com/pingcap/tiflow/cdc/sink/dmlsink/mq/dispatcher/topic"
diff --git a/cdc/sink/dmlsink/mq/dispatcher/partition/columns_test.go b/cdc/sink/dmlsink/mq/dispatcher/partition/columns_test.go
index 4ada308ca..d028d09bc 100644
--- a/cdc/sink/dmlsink/mq/dispatcher/partition/columns_test.go
+++ b/cdc/sink/dmlsink/mq/dispatcher/partition/columns_test.go
@@ -16,7 +16,8 @@ package partition
 import (
 	"testing"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -29,11 +30,11 @@ func TestColumnsDispatcher(t *testing.T) {
 
 	tidbTableInfo := &timodel.TableInfo{
 		ID:   100,
-		Name: timodel.NewCIStr("t1"),
+		Name: pmodel.NewCIStr("t1"),
 		Columns: []*timodel.ColumnInfo{
-			{ID: 1, Name: timodel.NewCIStr("col2"), Offset: 1, FieldType: *types.NewFieldType(mysql.TypeLong)},
-			{ID: 2, Name: timodel.NewCIStr("col1"), Offset: 0, FieldType: *types.NewFieldType(mysql.TypeLong)},
-			{ID: 3, Name: timodel.NewCIStr("col3"), Offset: 2, FieldType: *types.NewFieldType(mysql.TypeLong)},
+			{ID: 1, Name: pmodel.NewCIStr("col2"), Offset: 1, FieldType: *types.NewFieldType(mysql.TypeLong)},
+			{ID: 2, Name: pmodel.NewCIStr("col1"), Offset: 0, FieldType: *types.NewFieldType(mysql.TypeLong)},
+			{ID: 3, Name: pmodel.NewCIStr("col3"), Offset: 2, FieldType: *types.NewFieldType(mysql.TypeLong)},
 		},
 	}
 	tableInfo := model.WrapTableInfo(100, "test", 33, tidbTableInfo)
diff --git a/cdc/sink/dmlsink/mq/dispatcher/partition/index_value_test.go b/cdc/sink/dmlsink/mq/dispatcher/partition/index_value_test.go
index c6acca772..5a08fb158 100644
--- a/cdc/sink/dmlsink/mq/dispatcher/partition/index_value_test.go
+++ b/cdc/sink/dmlsink/mq/dispatcher/partition/index_value_test.go
@@ -16,7 +16,8 @@ package partition
 import (
 	"testing"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -147,18 +148,18 @@ func TestIndexValueDispatcherWithIndexName(t *testing.T) {
 
 	tidbTableInfo := &timodel.TableInfo{
 		ID:   100,
-		Name: timodel.NewCIStr("t1"),
+		Name: pmodel.NewCIStr("t1"),
 		Columns: []*timodel.ColumnInfo{
-			{ID: 1, Name: timodel.NewCIStr("a"), FieldType: *types.NewFieldType(mysql.TypeLong)},
+			{ID: 1, Name: pmodel.NewCIStr("a"), FieldType: *types.NewFieldType(mysql.TypeLong)},
 		},
 		Indices: []*timodel.IndexInfo{
 			{
-				Name: timodel.CIStr{
+				Name: pmodel.CIStr{
 					O: "index1",
 				},
 				Columns: []*timodel.IndexColumn{
 					{
-						Name: timodel.CIStr{
+						Name: pmodel.CIStr{
 							O: "a",
 						},
 					},
diff --git a/dm/master/server_test.go b/dm/master/server_test.go
index 545405d9b..741f36c38 100644
--- a/dm/master/server_test.go
+++ b/dm/master/server_test.go
@@ -35,9 +35,9 @@ import (
 	"github.com/pingcap/errors"
 	"github.com/pingcap/failpoint"
 	tiddl "github.com/pingcap/tidb/pkg/ddl"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/sessionctx"
 	"github.com/pingcap/tidb/pkg/util"
 	tidbmock "github.com/pingcap/tidb/pkg/util/mock"
diff --git a/dm/master/shardddl/optimist_test.go b/dm/master/shardddl/optimist_test.go
index 72825cca0..c188e2ec6 100644
--- a/dm/master/shardddl/optimist_test.go
+++ b/dm/master/shardddl/optimist_test.go
@@ -20,9 +20,9 @@ import (
 	"time"
 
 	tiddl "github.com/pingcap/tidb/pkg/ddl"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/sessionctx"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
 	"github.com/pingcap/tidb/pkg/util/mock"
diff --git a/dm/pkg/schema/tracker_test.go b/dm/pkg/schema/tracker_test.go
index 2a79cc65a..544341533 100644
--- a/dm/pkg/schema/tracker_test.go
+++ b/dm/pkg/schema/tracker_test.go
@@ -23,9 +23,9 @@ import (
 
 	"github.com/DATA-DOG/go-sqlmock"
 	"github.com/pingcap/tidb/pkg/ddl"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/util/filter"
 	timock "github.com/pingcap/tidb/pkg/util/mock"
diff --git a/dm/pkg/shardddl/optimism/info_test.go b/dm/pkg/shardddl/optimism/info_test.go
index c77c6e5bf..0cc22ad1d 100644
--- a/dm/pkg/shardddl/optimism/info_test.go
+++ b/dm/pkg/shardddl/optimism/info_test.go
@@ -22,9 +22,9 @@ import (
 
 	. "github.com/pingcap/check"
 	tiddl "github.com/pingcap/tidb/pkg/ddl"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/sessionctx"
 	"github.com/pingcap/tidb/pkg/util/mock"
 	"github.com/pingcap/tiflow/dm/common"
diff --git a/dm/pkg/shardddl/optimism/keeper_test.go b/dm/pkg/shardddl/optimism/keeper_test.go
index 4d67febbb..17e386603 100644
--- a/dm/pkg/shardddl/optimism/keeper_test.go
+++ b/dm/pkg/shardddl/optimism/keeper_test.go
@@ -17,8 +17,8 @@ import (
 	"testing"
 
 	. "github.com/pingcap/check"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/util/mock"
 	"github.com/pingcap/tiflow/dm/config/dbconfig"
 	"github.com/pingcap/tiflow/dm/pkg/conn"
diff --git a/dm/pkg/shardddl/optimism/lock_test.go b/dm/pkg/shardddl/optimism/lock_test.go
index bf9b4d0aa..f0aacdc1f 100644
--- a/dm/pkg/shardddl/optimism/lock_test.go
+++ b/dm/pkg/shardddl/optimism/lock_test.go
@@ -20,9 +20,9 @@ import (
 
 	"github.com/DATA-DOG/go-sqlmock"
 	. "github.com/pingcap/check"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/util/mock"
 	"github.com/pingcap/tidb/pkg/util/schemacmp"
 	"github.com/pingcap/tiflow/dm/config/dbconfig"
diff --git a/dm/syncer/dml_test.go b/dm/syncer/dml_test.go
index 749ba1560..016ee85f6 100644
--- a/dm/syncer/dml_test.go
+++ b/dm/syncer/dml_test.go
@@ -18,9 +18,9 @@ import (
 	"testing"
 
 	tiddl "github.com/pingcap/tidb/pkg/ddl"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tidb/pkg/sessionctx"
diff --git a/dm/syncer/dml_worker_test.go b/dm/syncer/dml_worker_test.go
index ca7a5fe62..8c9228ad3 100644
--- a/dm/syncer/dml_worker_test.go
+++ b/dm/syncer/dml_worker_test.go
@@ -17,9 +17,9 @@ import (
 	"testing"
 
 	tiddl "github.com/pingcap/tidb/pkg/ddl"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
 	timock "github.com/pingcap/tidb/pkg/util/mock"
 	cdcmodel "github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/pkg/sqlmodel"
diff --git a/dm/syncer/expr_filter_group_test.go b/dm/syncer/expr_filter_group_test.go
index 7bb15b68f..197504b06 100644
--- a/dm/syncer/expr_filter_group_test.go
+++ b/dm/syncer/expr_filter_group_test.go
@@ -17,8 +17,9 @@ import (
 	"context"
 	"testing"
 
+	"github.com/pingcap/errors"
 	ddl2 "github.com/pingcap/tidb/pkg/ddl"
-	context2 "github.com/pingcap/tidb/pkg/expression/context"
+	context2 "github.com/pingcap/tidb/pkg/expression/exprctx"
 	"github.com/pingcap/tidb/pkg/parser/ast"
 	"github.com/pingcap/tidb/pkg/util/filter"
 	"github.com/pingcap/tiflow/dm/config"
@@ -440,7 +441,7 @@ create table t (
 	require.NoError(t, err)
 	require.Len(t, exprs, 1)
 	expr := exprs[0]
-	require.Equal(t, "0", expr.StringWithCtx(context2.EmptyParamValues))
+	require.Equal(t, "0", expr.StringWithCtx(context2.EmptyParamValues, errors.RedactLogDisable))
 
 	// skip nothing
 	skip, err := SkipDMLByExpression(sessCtx, []interface{}{0}, expr, ti.Columns)
diff --git a/dm/syncer/shardddl/optimist_test.go b/dm/syncer/shardddl/optimist_test.go
index 0685e3ce6..f6378eaa1 100644
--- a/dm/syncer/shardddl/optimist_test.go
+++ b/dm/syncer/shardddl/optimist_test.go
@@ -19,9 +19,9 @@ import (
 
 	. "github.com/pingcap/check"
 	tiddl "github.com/pingcap/tidb/pkg/ddl"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/sessionctx"
 	"github.com/pingcap/tidb/pkg/util/mock"
 	"github.com/pingcap/tiflow/dm/pkg/log"
diff --git a/dm/syncer/status_test.go b/dm/syncer/status_test.go
index cb59adb6a..2afd6e930 100644
--- a/dm/syncer/status_test.go
+++ b/dm/syncer/status_test.go
@@ -18,7 +18,7 @@ import (
 
 	"github.com/go-mysql-org/go-mysql/mysql"
 	. "github.com/pingcap/check"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/util/filter"
 	"github.com/pingcap/tiflow/dm/config"
 	"github.com/pingcap/tiflow/dm/pb"
diff --git a/dm/syncer/util_test.go b/dm/syncer/util_test.go
index f89e6c6dc..21aca4ceb 100644
--- a/dm/syncer/util_test.go
+++ b/dm/syncer/util_test.go
@@ -21,7 +21,7 @@ import (
 	"github.com/DATA-DOG/go-sqlmock"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	_ "github.com/pingcap/tidb/pkg/types/parser_driver"
 	"github.com/pingcap/tidb/pkg/util/filter"
 	"github.com/pingcap/tiflow/dm/pkg/conn"
@@ -96,8 +96,8 @@ func TestGetTableByDML(t *testing.T) {
 func TestTableNameResultSet(t *testing.T) {
 	rs := &ast.TableSource{
 		Source: &ast.TableName{
-			Schema: model.NewCIStr("test"),
-			Name:   model.NewCIStr("t1"),
+			Schema: pmodel.NewCIStr("test"),
+			Name:   pmodel.NewCIStr("t1"),
 		},
 	}
 	table, err := tableNameResultSet(rs)
diff --git a/dm/syncer/validate_worker_test.go b/dm/syncer/validate_worker_test.go
index 241b38471..34161d040 100644
--- a/dm/syncer/validate_worker_test.go
+++ b/dm/syncer/validate_worker_test.go
@@ -24,7 +24,7 @@ import (
 	"github.com/pingcap/errors"
 	"github.com/pingcap/failpoint"
 	"github.com/pingcap/tidb/pkg/errno"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tidb/pkg/util/filter"
diff --git a/dm/syncer/validator_cond_test.go b/dm/syncer/validator_cond_test.go
index bdb8eed57..c553f2805 100644
--- a/dm/syncer/validator_cond_test.go
+++ b/dm/syncer/validator_cond_test.go
@@ -20,8 +20,8 @@ import (
 	"testing"
 
 	"github.com/DATA-DOG/go-sqlmock"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
-	"github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/util/dbutil/dbutiltest"
 	"github.com/pingcap/tidb/pkg/util/filter"
 	"github.com/stretchr/testify/require"
diff --git a/engine/pkg/meta/internal/sqlkv/sql_impl_test.go b/engine/pkg/meta/internal/sqlkv/sql_impl_test.go
index caf244f20..710868caf 100644
--- a/engine/pkg/meta/internal/sqlkv/sql_impl_test.go
+++ b/engine/pkg/meta/internal/sqlkv/sql_impl_test.go
@@ -145,8 +145,8 @@ func TestGet(t *testing.T) {
 			},
 			mockExpectResFn: func(mock sqlmock.Sqlmock) {
 				mock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `fakeTable` WHERE job_id = ? AND "+
-					"meta_key = ? ORDER BY `fakeTable`.`seq_id` LIMIT 1")).
-					WithArgs(fakeJob, []byte("key0")).
+					"meta_key = ? ORDER BY `fakeTable`.`seq_id` LIMIT ?")).
+					WithArgs(fakeJob, []byte("key0"), 1).
 					WillReturnRows(sqlmock.NewRows([]string{"meta_key", "meta_value"}))
 			},
 		},
@@ -167,8 +167,8 @@ func TestGet(t *testing.T) {
 			},
 			mockExpectResFn: func(mock sqlmock.Sqlmock) {
 				mock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `fakeTable` WHERE job_id = ? AND "+
-					"meta_key = ? ORDER BY `fakeTable`.`seq_id` LIMIT 1")).
-					WithArgs(fakeJob, []byte("key0")).
+					"meta_key = ? ORDER BY `fakeTable`.`seq_id` LIMIT ?")).
+					WithArgs(fakeJob, []byte("key0"), 1).
 					WillReturnRows(sqlmock.NewRows([]string{"meta_key", "meta_value"}).AddRow("key0", "value0"))
 			},
 		},
@@ -430,8 +430,8 @@ func TestSQLImplWithoutNamespace(t *testing.T) {
 	cli.Put(ctx, "key0", "value0")
 
 	mock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `meta_kvs` WHERE job_id = ? AND "+
-		"meta_key = ? ORDER BY `meta_kvs`.`seq_id` LIMIT 1")).
-		WithArgs("", []byte("key1")).
+		"meta_key = ? ORDER BY `meta_kvs`.`seq_id` LIMIT ?")).
+		WithArgs("", []byte("key1"), 1).
 		WillReturnRows(sqlmock.NewRows([]string{"key", "value"}))
 	cli.Get(ctx, "key1")
 
diff --git a/engine/pkg/orm/client_test.go b/engine/pkg/orm/client_test.go
index f89e857aa..20d9b6d99 100644
--- a/engine/pkg/orm/client_test.go
+++ b/engine/pkg/orm/client_test.go
@@ -206,7 +206,7 @@ func TestProject(t *testing.T) {
 				Name: "tenant1",
 			},
 			mockExpectResFn: func(mock sqlmock.Sqlmock) {
-				mock.ExpectQuery("SELECT [*] FROM `project_infos` WHERE id").WithArgs("111-222-333").WillReturnRows(
+				mock.ExpectQuery("SELECT [*] FROM `project_infos` WHERE id").WithArgs("111-222-333", 1).WillReturnRows(
 					sqlmock.NewRows([]string{
 						"created_at", "updated_at", "id", "name",
 						"seq_id",
@@ -220,7 +220,7 @@ func TestProject(t *testing.T) {
 			},
 			err: errors.ErrMetaOpFail.GenWithStackByArgs(),
 			mockExpectResFn: func(mock sqlmock.Sqlmock) {
-				mock.ExpectQuery("SELECT [*] FROM `project_infos` WHERE id").WithArgs("p111").WillReturnError(
+				mock.ExpectQuery("SELECT [*] FROM `project_infos` WHERE id").WithArgs("p111", 1).WillReturnError(
 					errors.New("GetProjectByID error"))
 			},
 		},
@@ -581,7 +581,7 @@ func TestJob(t *testing.T) {
 			},
 			mockExpectResFn: func(mock sqlmock.Sqlmock) {
 				expectedSQL := "SELECT * FROM `master_meta` WHERE id = ? AND `master_meta`.`deleted` IS NULL"
-				mock.ExpectQuery(regexp.QuoteMeta(expectedSQL)).WithArgs("j111").WillReturnRows(
+				mock.ExpectQuery(regexp.QuoteMeta(expectedSQL)).WithArgs("j111", 1).WillReturnRows(
 					sqlmock.NewRows([]string{
 						"created_at", "updated_at", "project_id", "id",
 						"type", "state", "node_id", "address", "epoch", "config", "seq_id", "ext",
@@ -597,7 +597,7 @@ func TestJob(t *testing.T) {
 			},
 			err: errors.ErrMetaOpFail.GenWithStackByArgs(),
 			mockExpectResFn: func(mock sqlmock.Sqlmock) {
-				mock.ExpectQuery("SELECT [*] FROM `master_meta` WHERE id").WithArgs("j111").WillReturnError(
+				mock.ExpectQuery("SELECT [*] FROM `master_meta` WHERE id").WithArgs("j111", 1).WillReturnError(
 					errors.New("GetJobByID error"))
 			},
 		},
@@ -836,7 +836,7 @@ func TestWorker(t *testing.T) {
 				ExtBytes:  []byte{0x11, 0x22},
 			},
 			mockExpectResFn: func(mock sqlmock.Sqlmock) {
-				mock.ExpectQuery("SELECT [*] FROM `worker_statuses` WHERE job_id").WithArgs("j111", "w222").WillReturnRows(
+				mock.ExpectQuery("SELECT [*] FROM `worker_statuses` WHERE job_id").WithArgs("j111", "w222", 1).WillReturnRows(
 					sqlmock.NewRows([]string{
 						"created_at", "updated_at", "project_id", "job_id",
 						"id", "type", "state", "epoch", "error_message", "extend_bytes", "seq_id",
@@ -852,7 +852,7 @@ func TestWorker(t *testing.T) {
 			},
 			err: errors.ErrMetaOpFail.GenWithStackByArgs(),
 			mockExpectResFn: func(mock sqlmock.Sqlmock) {
-				mock.ExpectQuery("SELECT [*] FROM `worker_statuses` WHERE job_id").WithArgs("j111", "w222").WillReturnError(
+				mock.ExpectQuery("SELECT [*] FROM `worker_statuses` WHERE job_id").WithArgs("j111", "w222", 1).WillReturnError(
 					errors.New("GetWorkerByID error"))
 			},
 		},
@@ -1140,7 +1140,7 @@ func TestResource(t *testing.T) {
 				Deleted:   true,
 			},
 			mockExpectResFn: func(mock sqlmock.Sqlmock) {
-				mock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `resource_meta` WHERE job_id = ? AND id = ?")).WithArgs("j111", "r222").WillReturnRows(
+				mock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `resource_meta` WHERE job_id = ? AND id = ?")).WithArgs("j111", "r222", 1).WillReturnRows(
 					sqlmock.NewRows([]string{
 						"created_at", "updated_at", "project_id", "id", "job_id",
 						"worker_id", "executor_id", "deleted", "seq_id",
@@ -1158,7 +1158,7 @@ func TestResource(t *testing.T) {
 			},
 			err: errors.ErrMetaOpFail.GenWithStackByArgs(),
 			mockExpectResFn: func(mock sqlmock.Sqlmock) {
-				mock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `resource_meta` WHERE job_id = ? AND id = ?")).WithArgs("j111", "r222").WillReturnError(
+				mock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `resource_meta` WHERE job_id = ? AND id = ?")).WithArgs("j111", "r222", 1).WillReturnError(
 					errors.New("GetResourceByID error"))
 			},
 		},
@@ -1387,7 +1387,7 @@ func TestError(t *testing.T) {
 	require.Nil(t, err)
 	require.Len(t, res, 0)
 
-	mock.ExpectQuery("SELECT [*] FROM `project_infos` WHERE id").WithArgs("p111").WillReturnRows(
+	mock.ExpectQuery("SELECT [*] FROM `project_infos` WHERE id").WithArgs("p111", 1).WillReturnRows(
 		sqlmock.NewRows([]string{
 			"created_at", "updated_at", "id", "name",
 			"seq_id",
@@ -1485,7 +1485,7 @@ func TestJobOp(t *testing.T) {
 					}).AddRow(1))
 				mock.ExpectQuery(
 					"SELECT [*] FROM `job_ops` WHERE job_id = ?").
-					WithArgs("job-111").WillReturnRows(
+					WithArgs("job-111", 1).WillReturnRows(
 					sqlmock.NewRows([]string{
 						"created_at", "updated_at", "op", "job_id", "seq_id",
 					}).AddRow(createdAt, updatedAt, model.JobOpStatusCanceling, "job-111", 1))
@@ -1511,7 +1511,7 @@ func TestJobOp(t *testing.T) {
 					}).AddRow(1))
 				mock.ExpectQuery(
 					"SELECT [*] FROM `job_ops` WHERE job_id = ?").
-					WithArgs("job-111").WillReturnRows(
+					WithArgs("job-111", 1).WillReturnRows(
 					sqlmock.NewRows([]string{
 						"created_at", "updated_at", "op", "job_id", "seq_id",
 					}).AddRow(createdAt, updatedAt, model.JobOpStatusCanceled, "job-111", 1))
@@ -1538,7 +1538,7 @@ func TestJobOp(t *testing.T) {
 					}).AddRow(1))
 				mock.ExpectQuery(
 					"SELECT [*] FROM `job_ops` WHERE job_id = ?").
-					WithArgs("job-111").WillReturnRows(
+					WithArgs("job-111", 1).WillReturnRows(
 					sqlmock.NewRows([]string{
 						"created_at", "updated_at", "op", "job_id", "seq_id",
 					}).AddRow(createdAt, updatedAt, model.JobOpStatusNoop, "job-111", 1))
diff --git a/engine/pkg/orm/model/logic_epoch_test.go b/engine/pkg/orm/model/logic_epoch_test.go
index ca55bceb6..b50643b13 100644
--- a/engine/pkg/orm/model/logic_epoch_test.go
+++ b/engine/pkg/orm/model/logic_epoch_test.go
@@ -91,8 +91,8 @@ func TestGenEpoch(t *testing.T) {
 	mock.ExpectBegin()
 	mock.ExpectExec(regexp.QuoteMeta("UPDATE `logic_epoches` SET `epoch`=epoch + ?,`updated_at`=? WHERE job_id = ?")).
 		WillReturnResult(sqlmock.NewResult(1, 1))
-	mock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `logic_epoches` WHERE job_id = ? ORDER BY `logic_epoches`.`seq_id` LIMIT 1")).
-		WithArgs("fakeJob").
+	mock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `logic_epoches` WHERE job_id = ? ORDER BY `logic_epoches`.`seq_id` LIMIT ?")).
+		WithArgs("fakeJob", 1).
 		WillReturnRows(sqlmock.NewRows([]string{"seq_id", "created_at", "updated_at", "job_id", "epoch"}).
 			AddRow(1, createdAt, updatedAt, "fakeJob", 11))
 	mock.ExpectCommit()
diff --git a/pkg/applier/redo_test.go b/pkg/applier/redo_test.go
index 2dc0582e2..51b6e2e3e 100644
--- a/pkg/applier/redo_test.go
+++ b/pkg/applier/redo_test.go
@@ -23,7 +23,7 @@ import (
 	"github.com/DATA-DOG/go-sqlmock"
 	"github.com/go-sql-driver/mysql"
 	"github.com/phayes/freeport"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	mysqlParser "github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/cdc/redo/reader"
diff --git a/pkg/diff/util_test.go b/pkg/diff/util_test.go
index a0c565e81..6696d2d1b 100644
--- a/pkg/diff/util_test.go
+++ b/pkg/diff/util_test.go
@@ -15,8 +15,9 @@ package diff
 
 import (
 	. "github.com/pingcap/check"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/util/dbutil"
 	"github.com/pingcap/tidb/pkg/util/dbutil/dbutiltest"
 )
@@ -58,11 +59,11 @@ func (s *testUtilSuite) TestRowContainsCols(c *C) {
 
 	cols := []*model.ColumnInfo{
 		{
-			Name: model.NewCIStr("a"),
+			Name: pmodel.NewCIStr("a"),
 		}, {
-			Name: model.NewCIStr("b"),
+			Name: pmodel.NewCIStr("b"),
 		}, {
-			Name: model.NewCIStr("c"),
+			Name: pmodel.NewCIStr("c"),
 		},
 	}
 
diff --git a/pkg/election/storage_orm_test.go b/pkg/election/storage_orm_test.go
index 443610f5e..9d21944d0 100644
--- a/pkg/election/storage_orm_test.go
+++ b/pkg/election/storage_orm_test.go
@@ -33,10 +33,11 @@ func newORMStorageAndMock(t *testing.T) (*ORMStorage, sqlmock.Sqlmock) {
 		WillReturnRows(sqlmock.NewRows([]string{"VERSION()"}).AddRow("5.7.35-log"))
 	db, err := ormUtil.NewGormDB(backendDB, "mysql")
 	require.NoError(t, err)
-	mock.ExpectQuery("SELECT SCHEMA_NAME from Information_schema.SCHEMATA " +
-		"where SCHEMA_NAME LIKE ? ORDER BY SCHEMA_NAME=? DESC limit 1").WillReturnRows(
-		sqlmock.NewRows([]string{"SCHEMA_NAME"}))
-	mock.ExpectExec("CREATE TABLE `test` (`id` int(10) unsigned,`leader_id` text NOT NULL," +
+	// seems new version of GORM doesn't need this
+	// mock.ExpectQuery("SELECT SCHEMA_NAME from Information_schema.SCHEMATA " +
+	//	"where SCHEMA_NAME LIKE ? ORDER BY SCHEMA_NAME=? DESC limit 1").WillReturnRows(
+	//	sqlmock.NewRows([]string{"SCHEMA_NAME"}))
+	mock.ExpectExec("CREATE TABLE `test` (`id` int(10) unsigned AUTO_INCREMENT,`leader_id` text NOT NULL," +
 		"`record` text,`version` bigint(20) unsigned NOT NULL,PRIMARY KEY (`id`))").
 		WillReturnResult(sqlmock.NewResult(0, 0))
 
@@ -49,8 +50,8 @@ func newORMStorageAndMock(t *testing.T) (*ORMStorage, sqlmock.Sqlmock) {
 func TestORMStorageGetEmptyRecord(t *testing.T) {
 	s, mock := newORMStorageAndMock(t)
 
-	mock.ExpectQuery("SELECT * FROM `test` WHERE id = ? LIMIT 1").
-		WithArgs(1).WillReturnRows(sqlmock.NewRows([]string{"id", "leader_id", "record", "version"}))
+	mock.ExpectQuery("SELECT * FROM `test` WHERE id = ? LIMIT ?").
+		WithArgs(1, 1).WillReturnRows(sqlmock.NewRows([]string{"id", "leader_id", "record", "version"}))
 	record, err := s.Get(context.Background())
 	require.NoError(t, err)
 	require.Equal(t, &Record{}, record)
@@ -76,8 +77,8 @@ func TestORMStorageGetExistingRecord(t *testing.T) {
 	recordBytes, err := json.Marshal(expectedRecord)
 	require.NoError(t, err)
 
-	mock.ExpectQuery("SELECT * FROM `test` WHERE id = ? LIMIT 1").
-		WithArgs(1).WillReturnRows(sqlmock.NewRows([]string{"id", "leader_id", "record", "version"}).
+	mock.ExpectQuery("SELECT * FROM `test` WHERE id = ? LIMIT ?").
+		WithArgs(1, 1).WillReturnRows(sqlmock.NewRows([]string{"id", "leader_id", "record", "version"}).
 		AddRow(1, "id1", recordBytes, 1))
 	record, err := s.Get(context.Background())
 	require.NoError(t, err)
@@ -189,8 +190,8 @@ func TestORMStorageTxnWithLeaderCheck(t *testing.T) {
 	s, mock := newORMStorageAndMock(t)
 
 	mock.ExpectBegin()
-	mock.ExpectQuery("SELECT `leader_id` FROM `test` WHERE id = ? and leader_id = ? LIMIT 1 LOCK IN SHARE MODE").
-		WithArgs(leaderRowID, "leader1").WillReturnRows(sqlmock.NewRows([]string{"leader_id"}))
+	mock.ExpectQuery("SELECT `leader_id` FROM `test` WHERE id = ? and leader_id = ? LIMIT ? LOCK IN SHARE MODE").
+		WithArgs(leaderRowID, "leader1", 1).WillReturnRows(sqlmock.NewRows([]string{"leader_id"}))
 	mock.ExpectRollback()
 	doNothing := func(*gorm.DB) error {
 		return nil
@@ -199,11 +200,11 @@ func TestORMStorageTxnWithLeaderCheck(t *testing.T) {
 	require.ErrorIs(t, err, errors.ErrElectorNotLeader)
 
 	mock.ExpectBegin()
-	mock.ExpectQuery("SELECT `leader_id` FROM `test` WHERE id = ? and leader_id = ? LIMIT 1 LOCK IN SHARE MODE").
-		WithArgs(leaderRowID, "leader1").
+	mock.ExpectQuery("SELECT `leader_id` FROM `test` WHERE id = ? and leader_id = ? LIMIT ? LOCK IN SHARE MODE").
+		WithArgs(leaderRowID, "leader1", 1).
 		WillReturnRows(sqlmock.NewRows([]string{"leader_id"}).AddRow("leader1"))
-	mock.ExpectQuery("SELECT * FROM `test` WHERE id = ? LIMIT 1").
-		WithArgs(1).WillReturnRows(sqlmock.NewRows([]string{"id", "leader_id", "record", "version"}))
+	mock.ExpectQuery("SELECT * FROM `test` WHERE id = ? LIMIT ?").
+		WithArgs(1, 1).WillReturnRows(sqlmock.NewRows([]string{"id", "leader_id", "record", "version"}))
 	mock.ExpectCommit()
 	doTxn := func(tx *gorm.DB) error {
 		_, err := s.Get(context.Background())
diff --git a/pkg/filter/filter_test.go b/pkg/filter/filter_test.go
index 9084d1e5c..7e6bdfdf4 100644
--- a/pkg/filter/filter_test.go
+++ b/pkg/filter/filter_test.go
@@ -16,7 +16,7 @@ package filter
 import (
 	"testing"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	bf "github.com/pingcap/tiflow/pkg/binlog-filter"
 	"github.com/pingcap/tiflow/pkg/config"
diff --git a/pkg/filter/filter_test_helper.go b/pkg/filter/filter_test_helper.go
index e5b4afedb..b11b07d4c 100644
--- a/pkg/filter/filter_test_helper.go
+++ b/pkg/filter/filter_test_helper.go
@@ -15,13 +15,14 @@ package filter
 
 import (
 	"testing"
+	"time"
 
 	ticonfig "github.com/pingcap/tidb/pkg/config"
 	tiddl "github.com/pingcap/tidb/pkg/ddl"
 	"github.com/pingcap/tidb/pkg/domain"
 	"github.com/pingcap/tidb/pkg/kv"
 	timeta "github.com/pingcap/tidb/pkg/meta"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/session"
 	"github.com/pingcap/tidb/pkg/store/mockstore"
 	"github.com/pingcap/tidb/pkg/testkit"
@@ -46,7 +47,7 @@ func newTestHelper(t *testing.T) *testHelper {
 	ticonfig.UpdateGlobal(func(conf *ticonfig.Config) {
 		conf.AlterPrimaryKey = true
 	})
-	session.SetSchemaLease(0)
+	session.SetSchemaLease(time.Second)
 	session.DisableStats4Test()
 	domain, err := session.BootstrapSession(store)
 	require.Nil(t, err)
diff --git a/pkg/filter/sql_event_filter_test.go b/pkg/filter/sql_event_filter_test.go
index 0ded5109c..b18c6ef31 100644
--- a/pkg/filter/sql_event_filter_test.go
+++ b/pkg/filter/sql_event_filter_test.go
@@ -17,7 +17,7 @@ import (
 	"testing"
 
 	"github.com/pingcap/errors"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/model"
 	bf "github.com/pingcap/tiflow/pkg/binlog-filter"
 	"github.com/pingcap/tiflow/pkg/config"
diff --git a/pkg/sink/cloudstorage/path_test.go b/pkg/sink/cloudstorage/path_test.go
index 500aa6916..57c5f2b30 100644
--- a/pkg/sink/cloudstorage/path_test.go
+++ b/pkg/sink/cloudstorage/path_test.go
@@ -23,7 +23,8 @@ import (
 	"time"
 
 	"github.com/google/uuid"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -299,7 +300,7 @@ func TestCheckOrWriteSchema(t *testing.T) {
 	ft := types.NewFieldType(mysql.TypeLong)
 	ft.SetFlag(mysql.PriKeyFlag | mysql.NotNullFlag)
 	col := &timodel.ColumnInfo{
-		Name:         timodel.NewCIStr("Id"),
+		Name:         pmodel.NewCIStr("Id"),
 		FieldType:    *ft,
 		DefaultValue: 10,
 	}
diff --git a/pkg/sink/cloudstorage/table_definition_test.go b/pkg/sink/cloudstorage/table_definition_test.go
index b6dcfc23e..6006b0833 100644
--- a/pkg/sink/cloudstorage/table_definition_test.go
+++ b/pkg/sink/cloudstorage/table_definition_test.go
@@ -18,8 +18,9 @@ import (
 	"math/rand"
 	"testing"
 
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/charset"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -31,7 +32,7 @@ func generateTableDef() (TableDefinition, *model.TableInfo) {
 	ft := types.NewFieldType(mysql.TypeLong)
 	ft.SetFlag(mysql.PriKeyFlag | mysql.NotNullFlag)
 	col := &timodel.ColumnInfo{
-		Name:         timodel.NewCIStr("Id"),
+		Name:         pmodel.NewCIStr("Id"),
 		FieldType:    *ft,
 		DefaultValue: 10,
 	}
@@ -41,7 +42,7 @@ func generateTableDef() (TableDefinition, *model.TableInfo) {
 	ft.SetFlag(mysql.NotNullFlag)
 	ft.SetFlen(128)
 	col = &timodel.ColumnInfo{
-		Name:         timodel.NewCIStr("LastName"),
+		Name:         pmodel.NewCIStr("LastName"),
 		FieldType:    *ft,
 		DefaultValue: "Default LastName",
 	}
@@ -50,7 +51,7 @@ func generateTableDef() (TableDefinition, *model.TableInfo) {
 	ft = types.NewFieldType(mysql.TypeVarchar)
 	ft.SetFlen(64)
 	col = &timodel.ColumnInfo{
-		Name:         timodel.NewCIStr("FirstName"),
+		Name:         pmodel.NewCIStr("FirstName"),
 		FieldType:    *ft,
 		DefaultValue: "Default FirstName",
 	}
@@ -58,7 +59,7 @@ func generateTableDef() (TableDefinition, *model.TableInfo) {
 
 	ft = types.NewFieldType(mysql.TypeDatetime)
 	col = &timodel.ColumnInfo{
-		Name:         timodel.NewCIStr("Birthday"),
+		Name:         pmodel.NewCIStr("Birthday"),
 		FieldType:    *ft,
 		DefaultValue: 12345678,
 	}
diff --git a/pkg/sink/codec/avro/avro_test.go b/pkg/sink/codec/avro/avro_test.go
index 4be0ee030..a2efab87a 100644
--- a/pkg/sink/codec/avro/avro_test.go
+++ b/pkg/sink/codec/avro/avro_test.go
@@ -20,7 +20,7 @@ import (
 	"time"
 
 	"github.com/linkedin/goavro/v2"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/pkg/config"
diff --git a/pkg/sink/codec/bootstraper_test.go b/pkg/sink/codec/bootstraper_test.go
index 1888cffb2..ae11bdc1e 100644
--- a/pkg/sink/codec/bootstraper_test.go
+++ b/pkg/sink/codec/bootstraper_test.go
@@ -19,7 +19,7 @@ import (
 	"testing"
 	"time"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tiflow/cdc/entry"
 	"github.com/pingcap/tiflow/cdc/model"
 	"github.com/pingcap/tiflow/pkg/config"
diff --git a/pkg/sink/codec/common/message_test.go b/pkg/sink/codec/common/message_test.go
index 4bc85b0da..dcd39316a 100644
--- a/pkg/sink/codec/common/message_test.go
+++ b/pkg/sink/codec/common/message_test.go
@@ -16,7 +16,8 @@ package common
 import (
 	"testing"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tidb/pkg/parser/types"
 	"github.com/pingcap/tiflow/cdc/model"
@@ -78,10 +79,10 @@ func TestCreate(t *testing.T) {
 		BinlogInfo: &timodel.HistoryInfo{
 			TableInfo: &timodel.TableInfo{
 				ID:   49,
-				Name: timodel.CIStr{O: "t1"},
+				Name: pmodel.CIStr{O: "t1"},
 				Columns: []*timodel.ColumnInfo{
-					{ID: 1, Name: timodel.CIStr{O: "id"}, FieldType: *ft, State: timodel.StatePublic},
-					{ID: 2, Name: timodel.CIStr{O: "a"}, FieldType: types.FieldType{}, State: timodel.StatePublic},
+					{ID: 1, Name: pmodel.CIStr{O: "id"}, FieldType: *ft, State: timodel.StatePublic},
+					{ID: 2, Name: pmodel.CIStr{O: "a"}, FieldType: types.FieldType{}, State: timodel.StatePublic},
 				},
 			},
 			FinishedTS: 420536581196873729,
@@ -95,9 +96,9 @@ func TestCreate(t *testing.T) {
 		},
 		TableInfo: &timodel.TableInfo{
 			ID:   49,
-			Name: timodel.CIStr{O: "t1"},
+			Name: pmodel.CIStr{O: "t1"},
 			Columns: []*timodel.ColumnInfo{
-				{ID: 1, Name: timodel.CIStr{O: "id"}, FieldType: *ft, State: timodel.StatePublic},
+				{ID: 1, Name: pmodel.CIStr{O: "id"}, FieldType: *ft, State: timodel.StatePublic},
 			},
 		},
 	}
diff --git a/pkg/sink/codec/simple/encoder_test.go b/pkg/sink/codec/simple/encoder_test.go
index 5536bf4a8..946a5bb29 100644
--- a/pkg/sink/codec/simple/encoder_test.go
+++ b/pkg/sink/codec/simple/encoder_test.go
@@ -25,7 +25,7 @@ import (
 
 	"github.com/DATA-DOG/go-sqlmock"
 	"github.com/golang/mock/gomock"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser/mysql"
 	"github.com/pingcap/tiflow/cdc/entry"
 	"github.com/pingcap/tiflow/cdc/model"
diff --git a/pkg/sqlmodel/row_change_test.go b/pkg/sqlmodel/row_change_test.go
index a6dd7e02d..da757cad4 100644
--- a/pkg/sqlmodel/row_change_test.go
+++ b/pkg/sqlmodel/row_change_test.go
@@ -17,10 +17,10 @@ import (
 	"testing"
 
 	"github.com/pingcap/tidb/pkg/ddl"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/parser"
 	"github.com/pingcap/tidb/pkg/parser/ast"
 	"github.com/pingcap/tidb/pkg/parser/charset"
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
 	_ "github.com/pingcap/tidb/pkg/planner/core" // init expression.EvalSimpleAst related function
 	timock "github.com/pingcap/tidb/pkg/util/mock"
 	cdcmodel "github.com/pingcap/tiflow/cdc/model"
diff --git a/pkg/sqlmodel/utils_test.go b/pkg/sqlmodel/utils_test.go
index c7c5fa27a..107a9a9dc 100644
--- a/pkg/sqlmodel/utils_test.go
+++ b/pkg/sqlmodel/utils_test.go
@@ -16,7 +16,8 @@ package sqlmodel
 import (
 	"testing"
 
-	timodel "github.com/pingcap/tidb/pkg/parser/model"
+	timodel "github.com/pingcap/tidb/pkg/meta/model"
+	pmodel "github.com/pingcap/tidb/pkg/parser/model"
 	"github.com/shopspring/decimal"
 	"github.com/stretchr/testify/require"
 )
@@ -47,18 +48,18 @@ func TestGeneratedColumnsNameSet(t *testing.T) {
 
 	cols := []*timodel.ColumnInfo{
 		{
-			Name:                timodel.CIStr{O: "A", L: "a"},
+			Name:                pmodel.CIStr{O: "A", L: "a"},
 			GeneratedExprString: "generated_expr",
 		},
 		{
-			Name: timodel.CIStr{O: "B", L: "b"},
+			Name: pmodel.CIStr{O: "B", L: "b"},
 		},
 		{
-			Name:                timodel.CIStr{O: "C", L: "c"},
+			Name:                pmodel.CIStr{O: "C", L: "c"},
 			GeneratedExprString: "generated_expr",
 		},
 		{
-			Name:                timodel.CIStr{O: "D", L: "d"},
+			Name:                pmodel.CIStr{O: "D", L: "d"},
 			GeneratedExprString: "generated_expr",
 		},
 	}
diff --git a/tests/integration_tests/resolve_lock/main.go b/tests/integration_tests/resolve_lock/main.go
index 74c210a99..bf8726f8a 100644
--- a/tests/integration_tests/resolve_lock/main.go
+++ b/tests/integration_tests/resolve_lock/main.go
@@ -32,7 +32,7 @@ import (
 	"github.com/pingcap/kvproto/pkg/kvrpcpb"
 	"github.com/pingcap/log"
 	"github.com/pingcap/tidb/pkg/kv"
-	"github.com/pingcap/tidb/pkg/parser/model"
+	"github.com/pingcap/tidb/pkg/meta/model"
 	"github.com/pingcap/tidb/pkg/store/driver"
 	"github.com/pingcap/tidb/pkg/tablecodec"
 	"github.com/pingcap/tiflow/tests/integration_tests/util"