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

Assigned expression is evaluated twice when updating column TIMESTAMP NOT NULL

    XMLWordPrintable

Details

    Description

      Assigned expression is evaluated twice when updating column TIMESTAMP NOT NULL. This does not happen on any other types of column and does not depend on table engine. This does not happen on MySQL 5.5.40, 5.6.21, but does on MariaDB 10.0.14 and 10.0.15.

      How to repeat:

      -- create table
      drop table if exists foo;
      create table foo(value TIMESTAMP NOT NULL);
       
      -- insert one row
      insert foo set value=now();
       
      -- update of 1 row takes 2 seconds instead of 1 second
      update foo set value=sleep(1);
       
      -- insert one more row (two rows total)
      insert foo set value=now();
       
      -- update of 2 rows takes 4 seconds instead of 2 seconds
      update foo set value=sleep(1);
       
       
      -- ----------------------------------------
      -- just for fun - make it NULL instead of NOT NULL:
      alter table foo modify column value TIMESTAMP NULL;
       
      -- update of 2 rows takes 2 seconds, as expected
      update foo set value=sleep(1);

      Attachments

        Activity

          People

            jplindst Jan Lindström (Inactive)
            slava Slava
            Votes:
            1 Vote for this issue
            Watchers:
            5 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.