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

sql: add switch for check constraint | tidb-test=pr/2160 #44954

Merged
merged 5 commits into from
Jun 26, 2023

Conversation

fzzf678
Copy link
Contributor

@fzzf678 fzzf678 commented Jun 26, 2023

What problem does this PR solve?

Issue Number: ref #41711

Problem Summary:

What is changed and how it works?

Add switch for check constraint, the default setting is OFF

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

Add switch for check constraint.

@fzzf678 fzzf678 requested a review from a team as a code owner June 26, 2023 08:28
@ti-chi-bot ti-chi-bot bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jun 26, 2023
@fzzf678 fzzf678 requested a review from CbcWestwolf June 26, 2023 08:28
@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 26, 2023
@tiprow
Copy link

tiprow bot commented Jun 26, 2023

Hi @fzzf678. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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/test-infra repository.

@fzzf678 fzzf678 requested a review from TonsnakeLin June 26, 2023 08:28
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jun 26, 2023
@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/test check-dev2

@tiprow
Copy link

tiprow bot commented Jun 26, 2023

@fzzf678: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test check-dev2

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/test-infra repository.

@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Jun 26, 2023
@fzzf678 fzzf678 changed the title sql: add switch for check constraint sql: add switch for check constraint | tidb-test=pr/2160 Jun 26, 2023
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 26, 2023
@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/retest

3 similar comments
@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/retest

@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/retest

@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/retest

@fzzf678 fzzf678 changed the title sql: add switch for check constraint | tidb-test=pr/2160 sql: add switch for check constraint Jun 26, 2023
@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/retest

@fzzf678 fzzf678 changed the title sql: add switch for check constraint sql: add switch for check constraint | tidb-test=pr/2160 Jun 26, 2023
@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/retest

3 similar comments
@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/retest

@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/retest

@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/retest

@fzzf678
Copy link
Contributor Author

fzzf678 commented Jun 26, 2023

/retest

@purelind
Copy link
Contributor

/test mysql-test

@tiprow
Copy link

tiprow bot commented Jun 26, 2023

@purelind: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test mysql-test

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/test-infra repository.

@@ -2751,6 +2751,12 @@ var defaultSysVars = []*SysVar{
return nil
},
},
{Scope: ScopeGlobal, Name: TiDBEnableCheckConstraint, Value: BoolToOnOff(DefTiDBEnableCheckConstraint), Type: TypeBool, SetGlobal: func(ctx context.Context, vars *SessionVars, s string) error {
Copy link
Contributor Author

@fzzf678 fzzf678 Jun 26, 2023

Choose a reason for hiding this comment

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

@CbcWestwolf PTAL at if this variable is correctly defined and used

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it is the way we use it.

@@ -2751,6 +2751,12 @@ var defaultSysVars = []*SysVar{
return nil
},
},
{Scope: ScopeGlobal, Name: TiDBEnableCheckConstraint, Value: BoolToOnOff(DefTiDBEnableCheckConstraint), Type: TypeBool, SetGlobal: func(ctx context.Context, vars *SessionVars, s string) error {
Copy link
Member

Choose a reason for hiding this comment

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

Yes, it is the way we use it.

@@ -2124,3 +2124,17 @@ func TestSetMppExchangeCompressionModeVariable(t *testing.T) {
require.Equal(t, warnings[0].Err.Error(), "mpp exchange compression won't work under current mpp version 0")
}
}

func TestSetEnableCheckConstraint(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

This test function is unnecessary since our system variable framework promises this cast.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@ti-chi-bot
Copy link

ti-chi-bot bot commented Jun 26, 2023

@CbcWestwolf: Your lgtm message is repeated, so it is ignored.

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/test-infra repository.

Copy link
Contributor

@TonsnakeLin TonsnakeLin 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 26, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jun 26, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-06-26 08:34:51.982064552 +0000 UTC m=+610257.383315003: ☑️ agreed by CbcWestwolf.
  • 2023-06-26 12:34:24.282721766 +0000 UTC m=+624629.683972215: ☑️ agreed by TonsnakeLin.

@fzzf678 fzzf678 requested review from qw4990, bb7133 and XuHuaiyu June 26, 2023 12:46
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jun 26, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CbcWestwolf, qw4990, TonsnakeLin

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
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.2: #44963.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 26, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.2 approved lgtm needs-cherry-pick-release-7.2 ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants