Error in TiDB-v5.3.1 when running analyze table: ERROR 1105 (HY000)

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB-v5.3.1 中 analyze table 报错:ERROR 1105 (HY000)

| username: TiDBer_明明

[Test Environment] TiDB
[TiDB Version] TiDB-v5.3.1
[Reproduction Path] Upgraded TiDB v4.0.9 to TiDB-v5.3.1 using tiup
[Encountered Issue: Phenomenon and Impact] Before the upgrade, the command analyze table sbtest_338; could be executed. After the upgrade, it reports an error: ERROR 1105 (HY000): Fast analyze hasn’t reached General Availability and only supports analyze version 1 currently.
[Resource Configuration]
No resource issues involved
[Attachments: Screenshots/Logs/Monitoring]

| username: tidb菜鸟一只 | Original post link

Check what the value of the tidb_analyze_version parameter is.

| username: TiDBer_明明 | Original post link

MySQL [sbtest]> show global variables like “%tidb_analyze_version%”;
±---------------------±------+
| Variable_name | Value |
±---------------------±------+
| tidb_analyze_version | 2 |
±---------------------±------+
1 row in set (0.01 sec)

| username: TiDBer_明明 | Original post link

Execute
MySQL [sbtest]> set global tidb_analyze_version=1;
Query OK, 0 rows affected (0.02 sec)
Then after re-logging in, it executed successfully
SQL [sbtest]> analyze table sbtest_338;
Query OK, 0 rows affected (1.03 sec)

| username: tidb狂热爱好者 | Original post link

The expert is impressive, asking and answering their own questions.

| username: xingzhenxiang | Original post link

Isn’t the default tidb_analyze_version 1?

| username: tidb菜鸟一只 | Original post link

In version v5.3.0 and later, the default value of this variable is 2. If the cluster is upgraded from a version prior to v5.3.0 to v5.3.0 or later, the default value of tidb_analyze_version does not change.

| username: TiDBer_明明 | Original post link

The first answer reminded me.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.