XMB Forum Software
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author: Subject: Oracle's MySQL actually handles UNIX_TIMESTAMP better than MariaDB!
flushedpancake
Member
***


Avatar


Posts: 35
Registered: 4-1-2024
Member Is Offline

Mood: Optimistic

[*] posted on 4-22-2024 at 11:13 AM
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]
View user's profile View All Posts By User
Xian
Member
***




Posts: 50
Registered: 9-12-2017
Location: Los Angeles, California
Member Is Offline

Mood: w00h00!

[*] posted on 5-1-2024 at 10:12 PM


Interesting... Thanks for the share!
View user's profile View All Posts By User
lottos
Administrator
********




Posts: 477
Registered: 6-3-2002
Member Is Offline

Mood: pass me a TimTam

[*] posted on 5-6-2024 at 01:23 AM


Have they fixed this or is there a workaround?
View user's profile View All Posts By User
flushedpancake
Member
***


Avatar


Posts: 35
Registered: 4-1-2024
Member Is Offline

Mood: Optimistic

[*] posted on 6-18-2024 at 08:53 AM


Quote: Originally posted by lottos  
Have they fixed this or is there a workaround?

If I remember right MariaDB basically pulled a 'won't fix' on it.



[insert witty quote here]
View user's profile View All Posts By User

  Go To Top

Powered by XMB 1.9.12 (Debug Mode)
XMB Forum Software © 2001-2024 The XMB Group
[Queries: 16] [PHP: 24.6% - SQL: 75.4%]