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

Digest text changes SQL semantic #18907

Closed
breezewish opened this issue Jul 31, 2020 · 5 comments
Closed

Digest text changes SQL semantic #18907

breezewish opened this issue Jul 31, 2020 · 5 comments
Labels
component/parser severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@breezewish
Copy link
Member

breezewish commented Jul 31, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Execute SQL statement:

SELECT SUM(TABLE_ROWS) FROM INFORMATION_SCHEMA.TABLES;

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

Expect a statement digest text that does not have syntax errors, like

SELECT SUM(TABLE_ROWS) FROM INFORMATION_SCHEMA.TABLES

in INFORMATION_SCHEMA.CLUSTER_STATEMENTS_SUMMARY_HISTORY table.

3. What did you see instead (Required)

select sum ( table_rows ) from information_schema . tables

Note that this SQL statement will throw syntax error:

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 12 near "( table_rows ) from information_schema . tables" , Time: 0.000000s

4. Affected version (Required)

My version is v4.0.2

5. Root Cause Analysis

@kennytm
Copy link
Contributor

kennytm commented Jul 31, 2020

while the extra spaces can be considered a bug, i don't think the digest text are supposed to be syntax-error-free (literals and lists are substituted by ? and ...).

@breezewish
Copy link
Member Author

@kennytm Yes, we only expect syntax-error free for this specific case.

@ghost ghost added the component/parser label Jul 31, 2020
@ghost
Copy link

ghost commented Jul 31, 2020

There are a couple of other issues with the digester if anyone wants to take a look at these together:
#14241
#18224

@bb7133
Copy link
Member

bb7133 commented Jan 20, 2022

Close this issue since it is duplicated with #30556.

@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
component/parser severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

5 participants