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) #15083

Closed

Conversation

sre-bot
Copy link
Contributor

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

cherry-pick #15012 to release-4.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 3, 2020

/run-all-tests

Comment on lines +187 to +191
<<<<<<< HEAD
=======
mem-quota-query = 10000
max-index-length = 3080
>>>>>>> 1771cf8... ddl, config: add a variable to control the max index length (#15012)
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix this conflict.

Comment on lines +244 to +256
<<<<<<< HEAD
=======
c.Assert(conf.MaxIndexLength, Equals, 3080)

_, err = f.WriteString(`
[log.file]
log-rotate = true`)
c.Assert(err, IsNil)
err = conf.Load(configFile)
tmp := err.(*ErrConfigValidationFailed)
c.Assert(isAllDeprecatedConfigItems(tmp.UndecodedItems), IsTrue)

>>>>>>> 1771cf8... ddl, config: add a variable to control the max index length (#15012)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

@zimulala
Copy link
Contributor

zimulala commented Mar 3, 2020

Don't need to cherry-pick.

@zimulala zimulala closed this Mar 3, 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 type/compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants