[MDEV-15750] preserve MYSQL_TYPE_TIMESTAMP in temporal arithmetics Created: 2018-04-02  Updated: 2023-11-10

Status: Stalled
Project: MariaDB Server
Component/s: Temporal Types
Fix Version/s: 11.0

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

Issue Links:
Blocks
is blocked by MDEV-15751 CURRENT_TIMESTAMP should return a TIM... In Review
is blocked by MDEV-16852 Get rid of Item_temporal_hybrid_func:... Closed
is blocked by MDEV-16864 Implement class Item_func_timestamp Closed
is blocked by MDEV-16874 Implement class Item_handled_func Closed
is blocked by MDEV-32496 TIMESTAMP variant to support YEAR ran... Open
Duplicate
duplicates MDEV-25279 Time operations do not consider dayli... Closed
Relates
relates to MDEV-15751 CURRENT_TIMESTAMP should return a TIM... In Review
relates to MDEV-15654 ADDTIME creates invalid timestamp val... Closed
relates to MDEV-30633 DATETIME to TIMESTAMP conversion to r... Stalled
relates to MDEV-32188 make TIMESTAMP use whole 32-bit unsig... In Testing

 Description   

create or replace table t1 (a timestamp);
insert t1 values ('2018-3-25 1:30:00');
create or replace table t2 as select a + interval 1 hour from t1;
show create table t2;

returns

+-------+----------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                             |
+-------+----------------------------------------------------------------------------------------------------------+
| t2    | CREATE TABLE `t2` (
  `a + interval 1 hour` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+----------------------------------------------------------------------------------------------------------+

Should be timestamp, not datetime.

This should cover all temporal arithmetic functions, e.g. ADDTIME too.



 Comments   
Comment by Marc [ 2022-01-01 ]

In a few months this will happen again. There should be a fix for that ready

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