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

ON UPDATE NOW on period fields could break constraints

    XMLWordPrintable

Details

    Description

      create or replace table t1(s timestamp on update now, e timestamp, period for apptime(s,e)); 

      Expected:

      Error cannot apply `on update now` on period field `s`

      Current behavior:

      MariaDB [test]> show create table t1;
      | Table | Create Table 
      | t1    | CREATE TABLE `t1` (
        `s` timestamp NOT NULL ON UPDATE current_timestamp(),
        `e` timestamp NOT NULL,
        PERIOD FOR `apptime` (`s`, `e`),
        CONSTRAINT `apptime` CHECK (`s` < `e`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      

      This could break constraints on update, because constraints are not checked for inserting fields

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              nikitamalyavin Nikita Malyavin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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