dolt icon indicating copy to clipboard operation
dolt copied to clipboard

Incorrect return typefor UNIX_TIMESTAMP

Open nicktobey opened this issue 10 months ago • 3 comments

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

nicktobey avatar Apr 05 '24 00:04 nicktobey

Can i take this one?

idnandre avatar Jun 25 '24 18:06 idnandre

Sure!

timsehn avatar Jun 25 '24 18:06 timsehn

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

timsehn avatar Jun 25 '24 18:06 timsehn

fixed in: https://github.com/dolthub/go-mysql-server/pull/2576

jycor avatar Jul 24 '24 19:07 jycor