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: fix the error message of too long key #15127

Merged
merged 2 commits into from
Mar 4, 2020

Conversation

zimulala
Copy link
Contributor

@zimulala zimulala commented Mar 4, 2020

What problem does this PR solve?

Set max-index-length = 12288
Before this PR:

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

After this PR:

tidb> create table t1 (a varchar(3073) primary key);
ERROR 1071 (42000): Specified key was too long; max key length is 12288 bytes

What is changed and how it works?

Fill index length in errTooLongKey after loading configure.

Check List

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Fix the value of the max key length in the error message of ErrTooLongKey

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.

Add a test case please?

@zimulala
Copy link
Contributor Author

zimulala commented Mar 4, 2020

@djshow832 Sorry, I didn't update the latest branch. Done.

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

@djshow832 djshow832 added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 4, 2020
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

@tangenta tangenta added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 4, 2020
@zimulala zimulala added the status/can-merge Indicates a PR has been approved by a committer. label Mar 4, 2020
@codecov
Copy link

codecov bot commented Mar 4, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@3465743). Click here to learn what that means.
The diff coverage is 100%.

@@             Coverage Diff             @@
##             master     #15127   +/-   ##
===========================================
  Coverage          ?   80.2898%           
===========================================
  Files             ?        502           
  Lines             ?     131932           
  Branches          ?          0           
===========================================
  Hits              ?     105928           
  Misses            ?      17619           
  Partials          ?       8385

@sre-bot
Copy link
Contributor

sre-bot commented Mar 4, 2020

/run-all-tests

@sre-bot sre-bot merged commit efa811a into pingcap:master Mar 4, 2020
sre-bot pushed a commit to sre-bot/tidb that referenced this pull request Mar 4, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Mar 4, 2020

cherry pick to release-3.0 in PR #15130

@zimulala zimulala deleted the too-long-key branch March 5, 2020 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants