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_extended unexpectedly became a reserved word #39573

Open
yejr opened this issue Dec 2, 2022 · 4 comments
Open

stats_extended unexpectedly became a reserved word #39573

yejr opened this issue Dec 2, 2022 · 4 comments
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/moderate sig/planner SIG: Planner type/bug This issue is a bug.

Comments

@yejr
Copy link

yejr commented Dec 2, 2022

Bug Report

$ tiup playground v6.1.2 --db 2 --pd 3 --kv 3 --tiflash 2
$ tiup client ...

my:root@127.0.0.1:4000=> select 1,'stats_extended' as stats_extended from dual;
error: mysql: 1064: You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 44 near "stats_extended from dual;"

my:root@127.0.0.1:4000=> select 1,'stats_extended' as `stats_extended` from dual;
 1 | stats_extended
---+----------------
 1 | stats_extended
(1 row)

my:root@127.0.0.1:4000=> select * from mysql.stats_extended limit 10;
(0 rows)

my:root@127.0.0.1:4000=> use mysql;
USE

my:root@127.0.0.1:4000=> select * from stats_extended limit 10;
error: mysql: 1064: You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 29 near "stats_extended limit 10;"
@yejr yejr added the type/bug This issue is a bug. label Dec 2, 2022
@CbcWestwolf
Copy link
Member

/assign

@CbcWestwolf
Copy link
Member

/unassign

@xiongjiwei xiongjiwei added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Dec 2, 2022
@bb7133 bb7133 added sig/planner SIG: Planner and removed sig/sql-infra SIG: SQL Infra labels Dec 2, 2022
@isabella0428
Copy link
Contributor

After examining the code, I think they reserve "stats_extended" on purpose. It also applies to "CURRENT_ROLE", "INTERSECT" and "TABLESAMPLE", in order to avoid parser conflict.

It is also listed as reserved keyword in the doc:
https://docs.pingcap.com/tidb/dev/keywords#S:~:text=STATS_COL_LIST-,STATS_EXTENDED%20(R),-STATS_HEALTHY%20(R)

@bb7133
Copy link
Member

bb7133 commented Jun 7, 2024

Hi @time-and-fate , are you still working on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/moderate sig/planner SIG: Planner type/bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

7 participants