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

DELETE FOR PORTION does not obey "Expression in FOR PORTION OF must be constant" limitation, data can be easily lost

    XMLWordPrintable

    Details

      Description

      create or replace table t1 (a int, s date, e date, period for p(s,e));
      insert into t1 values (1,'2012-01-01','2013-01-01'),(2,'2013-01-01','2014-01-01');
      delete from t1 for portion of p from s to e;
      select * from t1;
       
      # Cleanup
      drop table t1;
      

      10.5 69077dea

      MariaDB [bug]> delete from t1 for portion of p from s to e;
      Query OK, 2 rows affected (0.015 sec)
       
      MariaDB [bug]> select * from t1;
      Empty set (0.001 sec)
      

      UPDATE returns ER_NOT_CONSTANT_EXPRESSION, which is currently documented behavior for both UPDATE and DELETE.

        Attachments

          Activity

            People

            Assignee:
            nikitamalyavin Nikita Malyavin
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: