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

preserve MYSQL_TYPE_TIMESTAMP in temporal arithmetics

    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.

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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.