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

P1-[4.0 Bug Hunting]-[Window Function]-over function is weird #17737

Closed
sre-bot opened this issue Jun 5, 2020 · 3 comments
Closed

P1-[4.0 Bug Hunting]-[Window Function]-over function is weird #17737

sre-bot opened this issue Jun 5, 2020 · 3 comments
Assignees
Labels
challenge-program help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug. wontfix This issue will not be fixed.

Comments

@sre-bot
Copy link
Contributor

sre-bot commented Jun 5, 2020

Description

Bug Hunter issue tidb-challenge-program/bug-hunting-issue#93


Bug Report

1. What did you do?

mysql> create table t(a int, b int);                                                                                                                                               Query OK, 0 rows affected (0.00 sec)   

mysql> insert into t values(1,2);
Query OK, 1 row affected (0.00 sec)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
mysql> insert into t values(4,5);
Query OK, 1 row affected (0.00 sec)
                                                                                                                                                                                                                                                    
mysql> select (select sum(a) over ())  from t ;
+-------------------------+
| (select sum(a) over ()) |
+-------------------------+
|                       1 |
|                    NULL |
+-------------------------+
2 rows in set (0.00 sec)

mysql> select sum(a) over ()  from t ;
+----------------+
| sum(a) over () |
+----------------+
|              5 |
|              5 |
+----------------+
2 rows in set (0.00 sec)

2. What did you expect to see?

mysql> select (select sum(a) over ())  from t ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '())  from t' at line 1

mysql> select sum(a) over ()  from t ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '()  from t' at line 1

3. What did you see instead?

The results don't make any sense.

4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)

Reproducible on master branch:

commit 38298c2e3e8ae6438b2b9caa696586087ea58a4d (HEAD -> master, origin/master, origin/HEAD)
Author: Zhuomin(Charming) Liu <[email protected]>
Date:   Fri May 22 17:40:10 2020 +0800
mysql> select tidb_version();                                                                                                                                                      
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------$--------------------------------------------------------+
| tidb_version()
                                                        |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------$--------------------------------------------------------+
| Release Version: None
Edition: None
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.13.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

SIG slack channel

#sig-exec

Score

  • 900

Mentor

@sre-bot sre-bot added the type/bug The issue is confirmed as a bug. label Jun 5, 2020
@djshow832 djshow832 added the sig/execution SIG execution label Jun 5, 2020
@lzmhhh123 lzmhhh123 added challenge-program help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Oct 30, 2020
@dyzsr
Copy link
Contributor

dyzsr commented Dec 1, 2020

/assign

@lzmhhh123
Copy link
Contributor

Wrong issue.

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

@lzmhhh123 lzmhhh123 added the wontfix This issue will not be fixed. label Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenge-program help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug. wontfix This issue will not be fixed.
Projects
None yet
Development

No branches or pull requests

6 participants