-
Notifications
You must be signed in to change notification settings - Fork 489
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
parser: fix aggregate functions compatibility to MySQL8.0 #1123
Conversation
- std - stddev - stddev_pop - stddev_samp - var_pop - var_samp - variance
@@ -1,19 +1,26 @@ | |||
module github.com/pingcap/parser | |||
|
|||
require ( | |||
github.com/cznic/fileutil v0.0.0-20181122101858-4d67cfea8c87 // indirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think you need to modify go.mod
and go.sum
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
@@ -3243,6 +3243,48 @@ func (s *testParserSuite) TestErrorMsg(c *C) { | |||
|
|||
_, _, err = parser.Parse("select 1 collate some_unknown_collation", "", "") | |||
c.Assert(err.Error(), Equals, "[ddl:1273]Unknown collation: 'some_unknown_collation'") | |||
|
|||
_, _, err = parser.Parse("select std(all c1) from t", "", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're truly aiming for MySQL 8.0 compatibility then all
must still be supported.
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.20 |
+-----------+
1 row in set (0.00 sec)
mysql> select std(all a) from a;
+------------+
| std(all a) |
+------------+
| 0.5 |
+------------+
1 row in set (0.00 sec)
mysql> select std(distinct a) from a;
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 'distinct a) from a' at line 1
I think it should close for now, if it is necessary for related issue, we just let it re-open. |
What problem does this PR solve?
close #1116
What is changed and how it works?
change yacc rules of
SumExpr
below :Check List
Tests
Code changes
Side effects
Related changes