[MDEV-15751] CURRENT_TIMESTAMP should return a TIMESTAMP [WITH TIME ZONE?] Created: 2018-04-02  Updated: 2023-12-22

Status: In Review
Project: MariaDB Server
Component/s: Data types, Temporal Types
Fix Version/s: 11.5

Type: Task Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-15750 preserve MYSQL_TYPE_TIMESTAMP in temp... Stalled
is blocked by MDEV-10018 Timestamp with time zone Open
Relates
relates to MDEV-15654 ADDTIME creates invalid timestamp val... Closed
relates to MDEV-15750 preserve MYSQL_TYPE_TIMESTAMP in temp... Stalled

 Description   

create table t1 as select now();
show create table t1;

returns

+-------+----------------------------------------------------------------------------------------+
| Table | Create Table                                                                           |
+-------+----------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `now()` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+----------------------------------------------------------------------------------------+

should be timestamp.

These functions should also return TIMESTAMP:

  • FROM_UNIXTIME()
  • SYSDATE()


 Comments   
Comment by Alexander Barkov [ 2019-03-29 ]

According to the standard, it should return TIMESTAMP WITH TIMEZONE:

The declared type of a <current timestamp value function> is TIMESTAMP WITH TIME ZONE.

While, the best name for MariaDB's TIMESTAMP is "TIMESTAMP WITH LOCAL TIME ZONE".

So perhaps we should implement MDEV-10018 first.

Comment by Alexander Barkov [ 2023-02-14 ]

Hello serg, please review a patch for this task:
https://github.com/MariaDB/server/commit/fec3696fef6fb5a0be5f78632c056382f227e778

Generated at Thu Feb 08 08:23:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.