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

The result of stddev_pop(distinct xxx) is wrong #19676

Closed
Win-Man opened this issue Sep 1, 2020 · 1 comment · Fixed by #19680
Closed

The result of stddev_pop(distinct xxx) is wrong #19676

Win-Man opened this issue Sep 1, 2020 · 1 comment · Fixed by #19680
Labels
component/expression sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@Win-Man
Copy link
Contributor

Win-Man commented Sep 1, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

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

mysql> insert into t values(1),(2);
Query OK, 2 rows affected (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> select stddev_pop(id) from t;
+----------------+
| stddev_pop(id) |
+----------------+
|            0.5 |
+----------------+
1 row in set (0.00 sec)

mysql> insert into t values(1);
Query OK, 1 row affected (0.00 sec)

mysql> select stddev_pop(distinct id) from t;
+-------------------------+
| stddev_pop(distinct id) |
+-------------------------+
|      0.4714045207910317 |
+-------------------------+
1 row in set (0.00 sec)

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

mysql> select stddev_pop(distinct id) from t;
+----------------+
| stddev_pop(id) |
+----------------+
|            0.5 |
+----------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

Release Version: v4.0.0-beta.2-1111-gbdb673f5a
Edition: Community
Git Commit Hash: bdb673f5a2d5f8fb1602fcf121c3332b973a06d7
Git Branch: master
UTC Build Time: 2020-09-01 12:42:19
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@Win-Man Win-Man added the type/bug The issue is confirmed as a bug. label Sep 1, 2020
@ZenoTan
Copy link

ZenoTan commented Sep 2, 2020

/label status/PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants