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

Can't analyze columns with string longer than 65535 bytes #28793

Closed
time-and-fate opened this issue Oct 13, 2021 · 3 comments · Fixed by #28800
Closed

Can't analyze columns with string longer than 65535 bytes #28793

time-and-fate opened this issue Oct 13, 2021 · 3 comments · Fixed by #28800
Labels
severity/major sig/planner SIG: Planner type/bug This issue is a bug.

Comments

@time-and-fate
Copy link
Member

Bug Report

1. Minimal reproduce step (Required)

create table t(a longtext);
insert into t value(repeat("a",65535));
analyze table t with 0 topn;
insert into t value(repeat("a",65536));
analyze table t with 0 topn;

2. What did you expect to see? (Required)

Analyze successfully.

3. What did you see instead (Required)

The second analyze failed.

ERROR 1406 (22001): Data too long for column 'lower_bound' at row 1

4. What is your TiDB version? (Required)

master

@winoros
Copy link
Member

winoros commented Oct 14, 2021

This bug affects the old statistics also.
Increasing the sample size just increases the possibility the bug occurs.

@winoros winoros changed the title Can't analyze columns with string longer than 65535 bytes when using analyze ver2 Can't analyze columns with string longer than 65535 bytes Oct 14, 2021
@time-and-fate
Copy link
Member Author

This bug affects the old statistics also. Increasing the sample size just increases the possibility the bug occurs.

The old one has this PR. #7931 😂
You can try the example in the description with analyze_version set to 1. It can run successfully.

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/planner SIG: Planner type/bug This issue is a bug.
Projects
None yet
3 participants