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: table collation should follow schema #58482

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Dec 23, 2024

What problem does this PR solve?

Issue Number: close #58446

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.

The table collation now follows the schema collation if only the table collation is explicitly defined

@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. do-not-merge/needs-triage-completed labels Dec 23, 2024
Copy link

ti-chi-bot bot commented Dec 23, 2024

[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 assign gmhdbjd for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 23, 2024
Copy link

tiprow bot commented Dec 23, 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-sigs/prow repository.

@dveeden
Copy link
Contributor Author

dveeden commented Dec 23, 2024

/check-issue-triage-complete

@dveeden
Copy link
Contributor Author

dveeden commented Dec 23, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Dec 23, 2024
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 83.87097% with 10 lines in your changes missing coverage. Please review.

Project coverage is 74.8788%. Comparing base (6806af4) to head (a185412).
Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #58482        +/-   ##
================================================
+ Coverage   73.5201%   74.8788%   +1.3586%     
================================================
  Files          1681       1726        +45     
  Lines        464346     472475      +8129     
================================================
+ Hits         341388     353784     +12396     
+ Misses       102131      96412      -5719     
- Partials      20827      22279      +1452     
Flag Coverage Δ
integration 49.2052% <83.8709%> (?)

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 61.6119% <ø> (+15.8404%) ⬆️

Comment on lines 907 to 912
objectChs := charsetOpts[0].Chs
objectColl := charsetOpts[0].Col
if len(charsetOpts) > 1 {
templChs = charsetOpts[1].Chs
templColl = charsetOpts[1].Col
}
Copy link
Contributor

Choose a reason for hiding this comment

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

in ProcessColumnCharsetAndCollation, there might be 3 items in the slice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, so that's column, table, schema.

I'll make sure to add tests for that, and either make ResolveCharsetCollation handle this or have ProcessColumnCharsetAndCollation use a slice of 2 items.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't found any situation yet in which the third item in ProcessColumnCharsetAndCollation is useful.

if utf8mb4Coll != "" {
return chs, utf8mb4Coll, nil

if chs == "" || coll == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

it's odd to have such a branch without handling cases that any one of it is empty, we can move above handling to here

Copy link

tiprow bot commented Dec 24, 2024

@dveeden: 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
fast_test_tiprow a185412 link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Copy link

ti-chi-bot bot commented Dec 24, 2024

@dveeden: 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-unit-test-ddlv1 a185412 link true /test pull-unit-test-ddlv1
idc-jenkins-ci-tidb/unit-test a185412 link true /test unit-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Table collation doesn't follow schema
2 participants