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

Multi-update/Multi-delete for portion of time

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      create or replace table t (id int, s date, e date, period for apptime(s, e));
      insert into t values (1, '1999-01-01', '2018-12-12');
      create or replace table t1 (z int);
      insert into t1 values (1);
      update t for portion of apptime from '2000-01-01' to '2018-01-01', set t.id= t.id + 5;
      select * from t;
      

      Expected result:

      +------+------------+------------+
      | id   | s          | e          |
      +------+------------+------------+
      |    6 | 2000-01-01 | 2018-01-01 |
      |    1 | 1999-01-01 | 2000-01-01 |
      |    1 | 2018-01-01 | 2018-12-12 |
      +------+------------+------------+
      

      create or replace table t (id int, s date, e date, period for apptime(s,e));
      insert into t values(1, '1999-01-01', '2018-12-12');
      insert into t values(2, '1999-01-01', '2017-01-01');
      insert into t values(3, '2002-01-01', '2017-01-01');
      insert into t values(4, '1998-01-01', '2018-12-12');
      insert into t values(5, '1997-01-01', '2015-01-01');
      insert into t values(6, '2016-01-01', '2020-01-01');
      create or replace table t1 (id int, s date, e date, period for apptime(s,e));
      insert t1 select * from t;
      select * from t;
      delete t, t1 from t for portion of apptime from '2000-01-01' to '2018-01-01', t1;
      select * from t;
      

      Expected result:

      delete from t for portion of apptime from '2000-01-01' to '2018-01-01';
      +------+------------+------------+
      | id   | s          | e          |
      +------+------------+------------+
      |    1 | 1999-01-01 | 2000-01-01 |
      |    2 | 1999-01-01 | 2000-01-01 |
      |    4 | 1998-01-01 | 2000-01-01 |
      |    5 | 1997-01-01 | 2000-01-01 |
      |    6 | 2018-01-01 | 2020-01-01 |
      |    1 | 2018-01-01 | 2018-12-12 |
      |    4 | 2018-01-01 | 2018-12-12 |
      +------+------------+------------+
      

      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:

                Git Integration

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