[MDEV-22596] DELETE FOR PORTION does not obey "Expression in FOR PORTION OF must be constant" limitation, data can be easily lost Created: 2020-05-16  Updated: 2020-10-15  Resolved: 2020-10-15

Status: Closed
Project: MariaDB Server
Component/s: Versioned Tables
Affects Version/s: 10.4, 10.5
Fix Version/s: 10.4.16, 10.5.7

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Nikita Malyavin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks

 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.



 Comments   
Comment by Nayuta Yanagisawa (Inactive) [ 2020-10-11 ]

Hi @Nikita Malyavin

If you are OK, may I pick this issue? I'm interested in contributing MariaDB and seeking a good starting point. The present issue seems to be a good one for a beginner.

Comment by Nikita Malyavin [ 2020-10-11 ]

nayuta-yanagisawa sure, go on! I can't change an assignee because you are not under developer role in jira, but you can just make a pull request and then ping me for a review

Comment by Nayuta Yanagisawa (Inactive) [ 2020-10-11 ]

Thanks a lot! I will notify you as soon as I fix the bug.

Comment by Nayuta Yanagisawa (Inactive) [ 2020-10-12 ]

I've created PR. https://github.com/MariaDB/server/pull/1677

One of the build tests fails but, I think, it doesn't relate to my change.

Comment by Nikita Malyavin [ 2020-10-15 ]

Fixed by nayuta-yanagisawa, reviewed by me

Comment by Nayuta Yanagisawa (Inactive) [ 2020-10-15 ]

Thank you for your quick and supportive review!

Generated at Thu Feb 08 09:15:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.