flushedpancake
Member
Posts: 45
Registered: 4-1-2024
Member Is Offline
Mood: Optimistic
|
|
Oracle's MySQL actually handles UNIX_TIMESTAMP better than MariaDB!
MySQL
Code: | Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.36 MySQL Community Server - GPL
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> select unix_timestamp("2038-01-20");
+------------------------------+
| unix_timestamp("2038-01-20") |
+------------------------------+
| 2147558400 |
+------------------------------+
1 row in set (0.00 sec)
mysql> |
MariaDB
Code: | Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 11.2.3-MariaDB MariaDB package
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> select unix_timestamp("2038-01-20");
+------------------------------+
| unix_timestamp("2038-01-20") |
+------------------------------+
| NULL |
+------------------------------+
1 row in set (0.000 sec)
MariaDB [(none)]> |
This wasn't on the same system or even the same OS (I'm running Debian on the VPS, which uses MySQL 8, and openSUSE Tumbleweed on my desktop), though
both were running on 64-bit.
Pretty cool though, kinda interesting that Oracle decided to actually take into account if the user is running the database on 64-bit hardware and let
you use unix_timestamp() with a 64-bit date, while the MariaDB guys decided to arbitrarily enforce the 32-bit signed integer limit.
(Usually MariaDB seems to be the one people go for but in terms of future-proofing it looks like MySQL seems to be taking the lead here.)
[insert witty quote here]
|
|
Xian
Member
Posts: 50
Registered: 9-12-2017
Location: Los Angeles, California
Member Is Offline
Mood: w00h00!
|
|
Interesting... Thanks for the share!
|
|
lottos
Administrator
Posts: 479
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
Have they fixed this or is there a workaround?
|
|
flushedpancake
Member
Posts: 45
Registered: 4-1-2024
Member Is Offline
Mood: Optimistic
|
|
If I remember right MariaDB basically pulled a 'won't fix' on it.
[insert witty quote here]
|
|
flushedpancake
Member
Posts: 45
Registered: 4-1-2024
Member Is Offline
Mood: Optimistic
|
|
Apparently MariaDB fixed it too.
Wonder if they saw this thread. 🤣
[insert witty quote here]
|
|