dolthub / dolt

Dolt – Git for Data
Apache License 2.0
17.36k stars 488 forks source link

Incorrect return typefor UNIX_TIMESTAMP #7698

Open nicktobey opened 3 months ago

nicktobey commented 3 months ago

According to the MySQL docs:

The return value [of UNIX_TIMESTAMP] is an integer if no argument is given or the argument does not include a fractional seconds part, or [DECIMAL](https://dev.mysql.com/doc/refman/8.0/en/fixed-point-types.html) if an argument is given that includes a fractional seconds part.

However, we appear to always return a float even when no argument is given.

MySQL:

mysql> select unix_timestamp();
+------------------+
| unix_timestamp() |
+------------------+
|       1712276989 |
+------------------+

Dolt:

main*> select unix_timestamp();
+-----------------------+
| unix_timestamp()      |
+-----------------------+
| 1.712277000706879e+09 |
+-----------------------+

We appear to be re

idnandre commented 1 week ago

Can i take this one?

timsehn commented 1 week ago

Sure!

timsehn commented 1 week ago

https://docs.dolthub.com/guides/contributing