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

Precision controll on Pi() seems not work as mariadb does #26384

Open
hnes opened this issue Jul 20, 2021 · 0 comments
Open

Precision controll on Pi() seems not work as mariadb does #26384

hnes opened this issue Jul 20, 2021 · 0 comments
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@hnes
Copy link
Contributor

hnes commented Jul 20, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

select PI(), PI()+0.000000000000000000;
select PI(), PI()+0.0000000000000;
select PI(), PI()+0.0000000;

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

MariaDB [testdb]> select version();
+----------------+
| version()      |
+----------------+
| 5.5.68-MariaDB |
+----------------+
1 row in set (0.00 sec)

MariaDB [testdb]> select PI(), PI()+0.000000000000000000;
+----------+---------------------------+
| PI()     | PI()+0.000000000000000000 |
+----------+---------------------------+
| 3.141593 |      3.141592653589793000 |
+----------+---------------------------+
1 row in set (0.00 sec)

MariaDB [testdb]> select PI(), PI()+0.0000000000000;
+----------+----------------------+
| PI()     | PI()+0.0000000000000 |
+----------+----------------------+
| 3.141593 |      3.1415926535898 |
+----------+----------------------+
1 row in set (0.00 sec)

MariaDB [testdb]> select PI(), PI()+0.0000000;
+----------+----------------+
| PI()     | PI()+0.0000000 |
+----------+----------------+
| 3.141593 |      3.1415927 |
+----------+----------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

MySQL [testdb]> select PI(), PI()+0.000000000000000000;
+----------+---------------------------+
| PI()     | PI()+0.000000000000000000 |
+----------+---------------------------+
| 3.141593 |         3.141592653589793 |
+----------+---------------------------+
1 row in set (0.00 sec)

MySQL [testdb]> select PI(), PI()+0.0000000000000;
+----------+----------------------+
| PI()     | PI()+0.0000000000000 |
+----------+----------------------+
| 3.141593 |    3.141592653589793 |
+----------+----------------------+
1 row in set (0.00 sec)

MySQL [testdb]> select PI(), PI()+0.0000000;
+----------+-------------------+
| PI()     | PI()+0.0000000    |
+----------+-------------------+
| 3.141593 | 3.141592653589793 |
+----------+-------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

MySQL [testdb]> SELECT tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                                       |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.1.0
Edition: Community
Git Commit Hash: 8acd5c88471cb7b4d4c4a8ed73b4d53d6833f13e
Git Branch: heads/refs/tags/v5.1.0
UTC Build Time: 2021-06-24 07:10:32
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@hnes hnes added the type/bug The issue is confirmed as a bug. label Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants