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

ddl: Better error when check constraint is off #52814

Merged
merged 4 commits into from
May 15, 2024

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Apr 22, 2024

What problem does this PR solve?

Issue Number: close #52815

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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.

None

@dveeden dveeden requested review from Defined2014 and fzzf678 April 22, 2024 14:54
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 22, 2024
Copy link

tiprow bot commented Apr 22, 2024

Hi @dveeden. 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.

@dveeden
Copy link
Contributor Author

dveeden commented Apr 22, 2024

Without this PR:

mysql> CREATE TABLE t1 (id INT PRIMARY KEY, CHECK (id<10));
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> SHOW WARNINGS;
+---------+------+---------------------------------------+
| Level   | Code | Message                               |
+---------+------+---------------------------------------+
| Warning | 1105 | the switch of check constraint is off |
+---------+------+---------------------------------------+
1 row in set (0.00 sec)

With this PR:

mysql> CREATE TABLE t2 (id INT PRIMARY KEY, CHECK (id<10));
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> SHOW WARNINGS;
+---------+------+-------------------------------------+
| Level   | Code | Message                             |
+---------+------+-------------------------------------+
| Warning | 1105 | tidb_enable_check_constraint is off |
+---------+------+-------------------------------------+
1 row in set (0.00 sec)

This makes it easier for the user to find out what variable they might have to change and lookup the right docs etc.

@dveeden
Copy link
Contributor Author

dveeden commented Apr 22, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added ok-to-test Indicates a PR is ready to be tested. and removed do-not-merge/needs-linked-issue labels Apr 22, 2024
@Defined2014
Copy link
Contributor

/retest

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 74.3141%. Comparing base (f0af776) to head (4821014).
Report is 2 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52814        +/-   ##
================================================
- Coverage   74.3523%   74.3141%   -0.0383%     
================================================
  Files          1494       1513        +19     
  Lines        356302     447013     +90711     
================================================
+ Hits         264919     332194     +67275     
- Misses        72035      94418     +22383     
- Partials      19348      20401      +1053     
Flag Coverage Δ
integration 49.1668% <40.0000%> (?)
unit 71.2646% <0.0000%> (-1.8416%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 46.7395% <ø> (+3.7726%) ⬆️

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Apr 23, 2024
pkg/ddl/ddl_api.go Outdated Show resolved Hide resolved
@dveeden dveeden requested a review from zimulala April 26, 2024 08:52
@dveeden
Copy link
Contributor Author

dveeden commented Apr 26, 2024

/retest

1 similar comment
@dveeden
Copy link
Contributor Author

dveeden commented Apr 26, 2024

/retest

@dveeden
Copy link
Contributor Author

dveeden commented Apr 30, 2024

@zimulala @fzzf678 PTAL

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 6, 2024
Copy link

ti-chi-bot bot commented May 6, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-23 01:19:01.951873965 +0000 UTC m=+50298.691776877: ☑️ agreed by Defined2014.
  • 2024-05-06 08:48:39.135978312 +0000 UTC m=+865472.893113885: ☑️ agreed by fzzf678.

Copy link

ti-chi-bot bot commented May 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, fzzf678, zimulala

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 the approved label May 6, 2024
@ti-chi-bot ti-chi-bot bot merged commit 63cf3e5 into pingcap:master May 15, 2024
23 checks passed
terry1purcell pushed a commit to terry1purcell/tidb that referenced this pull request May 17, 2024
RidRisR pushed a commit to RidRisR/tidb that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The error for disabled check constraints can be improved
4 participants