The compatibility issue of the PI() function in MySQL and TiDB.
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
Use function over PI()
### 2. What did you expect to see? (Required)
The same behavior between TiDB and MySQL
### 3. What did you see instead (Required)
```sql
// TiDB
mysql> SELECT TAN(PI()+1);
+--------------------+
| TAN(PI()+1) |
+--------------------+
| 1.5574077246549016 |
+--------------------+
1 row in set (0.04 sec)
mysql> SELECT TAN(PI());
+-------------------------+
| TAN(PI()) |
+-------------------------+
| -1.2246467991473515e-16 |
+-------------------------+
1 row in set (0.03 sec)
mysql> SELECT SIN(PI());
+------------------------+
| SIN(PI()) |
+------------------------+
| 1.2246467991473515e-16 |
+------------------------+
1 row in set (0.04 sec)
// MySQL
mysql> SELECT TAN(PI()+1);
+--------------------+
| TAN(PI()+1) |
+--------------------+
| 1.5574077246549018 |
+--------------------+
1 row in set (0.02 sec)
mysql> SELECT TAN(PI());
+-------------------------+
| TAN(PI()) |
+-------------------------+
| -1.2246467991473532e-16 |
+-------------------------+
1 row in set (0.00 sec)
mysql> SELECT SIN(PI());
+------------------------+
| SIN(PI()) |
+------------------------+
| 1.2246467991473532e-16 |
+------------------------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
TiDB v8.4.0
MySQL v8.4.1
Contributor guide
Assessment
This issue has not been assessed yet.