Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

sink(ticdc): fix incorrect default field #12038

Merged
merged 8 commits into from
Feb 8, 2025
Merged

Conversation

wk989898
Copy link
Collaborator

@wk989898 wk989898 commented Jan 24, 2025

What problem does this PR solve?

Issue Number: close #12037

What is changed and how it works?

OriginDefaultValue is used as the column value when the default value is invisible.
It should not be used as the default field.

Affected protocol

  • Cloud Storage
  • Simple
  • Avro
  • Debezium

Check List

Tests

  • Unit test
  • Integration test

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

fix incorrect `default` field.

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 24, 2025
@wk989898 wk989898 added needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. labels Jan 27, 2025
Copy link
Contributor

ti-chi-bot bot commented Feb 5, 2025

@flowbehappy: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@@ -501,9 +501,6 @@ func (ti *TableInfo) GetPrimaryKeyColumnNames() []string {
// GetColumnDefaultValue returns the default definition of a column.
func GetColumnDefaultValue(col *model.ColumnInfo) interface{} {
defaultValue := col.GetDefaultValue()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks can return the col.GetDefaultValue() directly.

@3AceShowHand
Copy link
Contributor

Is the method GetColumnDefaultValue only used by encoding protocols ?

Will this modification also affect other components?

@wk989898
Copy link
Collaborator Author

wk989898 commented Feb 5, 2025

Is the method GetColumnDefaultValue only used by encoding protocols ?

Will this modification also affect other components?

I tracked this method and found it was only used in the schema encoding.

@3AceShowHand
Copy link
Contributor

GetColumnDefaultValue can be removed, just call col.GetDefaultValue() should works.

@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 5, 2025
@wk989898 wk989898 requested a review from lidezhu February 5, 2025 08:58
Copy link
Collaborator

@lidezhu lidezhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 6, 2025
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 6, 2025
@wk989898
Copy link
Collaborator Author

wk989898 commented Feb 6, 2025

/test pull-cdc-integration-kafka-test

@wk989898
Copy link
Collaborator Author

wk989898 commented Feb 7, 2025

/retest-required

@wk989898
Copy link
Collaborator Author

wk989898 commented Feb 7, 2025

/retest

Copy link
Contributor

ti-chi-bot bot commented Feb 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: asddongmen, flowbehappy, lidezhu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 8, 2025
Copy link
Contributor

ti-chi-bot bot commented Feb 8, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-06 07:08:14.983080906 +0000 UTC m=+341966.515492903: ☑️ agreed by lidezhu.
  • 2025-02-08 02:43:27.713679113 +0000 UTC m=+65250.109901172: ☑️ agreed by asddongmen.

@wk989898
Copy link
Collaborator Author

wk989898 commented Feb 8, 2025

/test pull-engine-integration-test

@wk989898
Copy link
Collaborator Author

wk989898 commented Feb 8, 2025

/retest

@ti-chi-bot ti-chi-bot bot merged commit 600286c into pingcap:master Feb 8, 2025
26 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #12049.
But this PR has conflicts, please resolve them!

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Feb 8, 2025
ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Feb 8, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #12050.
But this PR has conflicts, please resolve them!

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #12051.
But this PR has conflicts, please resolve them!

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Feb 8, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #12052.
But this PR has conflicts, please resolve them!

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Feb 8, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #12053.
But this PR has conflicts, please resolve them!

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.1: #12054.
But this PR has conflicts, please resolve them!

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

incorrect default value after altering an ADDed column from NOT NULL to NULL
6 participants