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

TiDB v5.2.1 Parser Unexpected Error #28476

Closed
CodingPoeta opened this issue Sep 29, 2021 · 3 comments · Fixed by #29656 · May be fixed by pingcap/parser#1366 or #30263
Closed

TiDB v5.2.1 Parser Unexpected Error #28476

CodingPoeta opened this issue Sep 29, 2021 · 3 comments · Fixed by #29656 · May be fixed by pingcap/parser#1366 or #30263
Assignees
Labels
affects-5.2 This bug affects 5.2.x versions. component/parser severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@CodingPoeta
Copy link

CodingPoeta commented Sep 29, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> SELECT COUNT(*) FROM plan_executions WHERE (EXISTS((SELECT * FROM triggers WHERE plan_executions.trigger_id=triggers.id AND triggers.type='CRON')));

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

If I change the "(())" after 'EXISTS' into "()", there will be no error:

mysql> SELECT COUNT(*) FROM plan_executions WHERE (EXISTS(SELECT * FROM triggers WHERE plan_executions.trigger_id=triggers.id AND triggers.type='CRON'));
+----------+
| COUNT(*) |
+----------+
|        3 |
+----------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

An error:
ERROR 1064 (42000): 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 146 near "))"

4. What is your TiDB version? (Required)

V5.2.1 (In previous version of tidb--v5.1.1, It is OK to execute )

@CodingPoeta CodingPoeta added the type/bug The issue is confirmed as a bug. label Sep 29, 2021
@CodingPoeta CodingPoeta changed the title [wip] TiDB v [wip] TiDB v5.2.1 Parser Unexpected Error Sep 29, 2021
@CodingPoeta CodingPoeta changed the title [wip] TiDB v5.2.1 Parser Unexpected Error TiDB v5.2.1 Parser Unexpected Error Sep 29, 2021
@kennytm
Copy link
Contributor

kennytm commented Sep 29, 2021

simplified:

select exists((select 1));

@kennytm kennytm added component/parser sig/sql-infra SIG: SQL Infra affects-5.2 This bug affects 5.2.x versions. labels Sep 29, 2021
@bb7133
Copy link
Member

bb7133 commented Oct 8, 2021

Confirmed that it is a regression: introduced by #25647

@github-actions
Copy link

github-actions bot commented Dec 2, 2021

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
affects-5.2 This bug affects 5.2.x versions. component/parser severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
4 participants