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

Incorrect return typefor UNIX_TIMESTAMP #7698

Open
nicktobey opened this issue Apr 5, 2024 · 0 comments
Open

Incorrect return typefor UNIX_TIMESTAMP #7698

nicktobey opened this issue Apr 5, 2024 · 0 comments
Labels
bug Something isn't working correctness We don't return the same result as MySQL sql Issue with SQL

Comments

@nicktobey
Copy link
Contributor

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

@timsehn timsehn added bug Something isn't working sql Issue with SQL correctness We don't return the same result as MySQL labels Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctness We don't return the same result as MySQL sql Issue with SQL
Projects
None yet
Development

No branches or pull requests

2 participants