Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15750

preserve MYSQL_TYPE_TIMESTAMP in temporal arithmetic

    XMLWordPrintable

    Details

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: