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, config: add a variable to control the max index length (#15012) #15057

Merged
merged 2 commits into from
Mar 2, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Mar 2, 2020

cherry-pick #15012 to release-3.0


What problem does this PR solve?

Before #13727(v3.0.8):

create table t (a varchar(1000) primary key);
Query OK, 0 rows affected

After #13727:

tidb> create table t (a varchar(1000) primary key);
ERROR 1071 (42000): Specified key was too long; max key length is 3072 bytes

Therefore, in v3.0.8 and after, such statements will report an error, which is not compatible with the behavior of versions before v3.0.8.

What is changed and how it works?

Add a variable to control the max index length. And the value range is [3072, 3072*4].
The default value is 3072, it is consistent with MySQL.

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Add a variable to control the maximum index length.

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

/run-all-tests

config/config.toml.example Outdated Show resolved Hide resolved
@zimulala
Copy link
Contributor

zimulala commented Mar 2, 2020

Copy link
Contributor

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala zimulala added the status/can-merge Indicates a PR has been approved by a committer. label Mar 2, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

/run-all-tests

@sre-bot sre-bot merged commit b1b50b1 into pingcap:release-3.0 Mar 2, 2020
@zimulala zimulala added sig/sql-infra SIG: SQL Infra and removed component/DDL1 labels Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/release-blocker This issue blocks a release. Please solve it ASAP. sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. type/compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants