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

[stats] auto analyze failed #35948

Closed
zhuzhenwen-github opened this issue Jul 5, 2022 · 6 comments · Fixed by #47928
Closed

[stats] auto analyze failed #35948

zhuzhenwen-github opened this issue Jul 5, 2022 · 6 comments · Fixed by #47928

Comments

@zhuzhenwen-github
Copy link

Bug Report

[analyze.go:1435] ["analyze worker panicked"] [recover="runtime error: slice bounds out of range [-1:]"] [stack="github.com/pingcap/tidb/executor.(*AnalyzeColumnsExec).subBuildWorker.func1\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/analyze.go:1435\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:838\nruntime.goPanicSliceB\n\t/usr/local/go/src/runtime/panic.go:117\ngithub.com/pingcap/tidb/statistics.BuildHistAndTopN\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/statistics/builder.go:346\ngithub.com/pingcap/tidb/executor.(*AnalyzeColumnsExec).subBuildWorker\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/analyze.go:1559\ngithub.com/pingcap/tidb/executor.(*AnalyzeColumnsExec).buildSamplingStats.func3\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/analyze.go:1136\ngithub.com/pingcap/tidb/executor.(*notifyErrorWaitGroupWrapper).Run.func1\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/analyze.go:2653"]

1. Minimal reproduce step (Required)

Execute commands manually "analyze table ${tableName}"

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

auto analyze success

3. What did you see instead (Required)

SHOW ANALYZE STATUS;
State:failed
Fail_reason:runtime error: slice bounds out of range [-1:]

4. What is your TiDB version? (Required)

Release Version: v6.1.0
Edition: Community
Git Commit Hash: 1a89dec
Git Branch: heads/refs/tags/v6.1.0
UTC Build Time: 2022-06-05 05:15:11
GoVersion: go1.18.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@zhuzhenwen-github zhuzhenwen-github added the type/bug This issue is a bug. label Jul 5, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 labels Jul 5, 2022
@chrysan
Copy link
Contributor

chrysan commented Jul 6, 2022

@zhuzhenwen-github Can you provide more details about the reproduce steps?

@zhuzhenwen-github
Copy link
Author

@chrysan
Copy link
Contributor

chrysan commented Jul 6, 2022

@zhuzhenwen-github when I tried to reproduce in my local env, I got:

mysql> source [gt_eat_pay_t_eat_arr_order_main_son_meta.txt](https://github.com/pingcap/tidb/files/9052693/gt_eat_pay_t_eat_arr_order_main_son_meta.txt)
ERROR 1273 (HY000): Unsupported collation when new collation is enabled: 'utf8_general_mysql500_ci'

Is your env upgraded from old version?
Can you help check your env:

  1. value of config "new_collations_enabled_on_first_bootstrap"
mysql> show variables like "%collation%";

@zhuzhenwen-github
Copy link
Author

zhuzhenwen-github commented Jul 7, 2022

@zhuzhenwen-github when I tried to reproduce in my local env, I got:

mysql> source [gt_eat_pay_t_eat_arr_order_main_son_meta.txt](https://github.com/pingcap/tidb/files/9052693/gt_eat_pay_t_eat_arr_order_main_son_meta.txt)
ERROR 1273 (HY000): Unsupported collation when new collation is enabled: 'utf8_general_mysql500_ci'

Is your env upgraded from old version? Can you help check your env:
yes, from 5.4 to 6.0,and then from 6.0 to 6.1 @chrysan

  1. value of config "new_collations_enabled_on_first_bootstrap"

c1

mysql> show variables like "%collation%";

c2

@wjhuang2016
Copy link
Member

Could you show us the result of
select * from mysql.tidb where VARIABLE_NAME="new_collation_enabled";?

@zhuzhenwen-github
Copy link
Author

Could you show us the result of select * from mysql.tidb where VARIABLE_NAME="new_collation_enabled";?

image

@winoros winoros removed may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. affects-6.1 affects-6.2 affects-6.3 affects-6.4 may-affects-6.0 affects-6.6 affects-7.0 labels Oct 17, 2023
ti-chi-bot bot pushed a commit that referenced this issue Oct 25, 2023
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this issue Oct 25, 2023
yibin87 pushed a commit to yibin87/tidb that referenced this issue Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants