stonedb icon indicating copy to clipboard operation
stonedb copied to clipboard

bug: incorrect result set.Before delete trigger,Does not take effect

Open shangyanwen opened this issue 1 year ago • 1 comments

Describe the problem

create table t1 (i int)engine=tianmu;
insert into t1 values (1),(2),(3),(4);
create trigger trg before delete on t1 for each row
  set @del_sum:= @del_sum + old.i;
set @del_sum:= 0;
delete from t1 where i <= 3;
select @del_sum;

##Incorrect test results
select @del_sum;
+----------+
| @del_sum |
+----------+
|        0 |
+----------+

drop trigger trg;
drop table t1;

Expected behavior

#Correct test results(note:Innodb test verification, test results are as follows)
mysql> select @del_sum;
+----------+
| @del_sum |
+----------+
|        6 |
+----------+
1 row in set (0.00 sec)

How To Reproduce

Follow the test steps above

Environment

./mysqld  Ver 5.7.36_v1.0.1_beta-StoneDB for Linux on x86_64 (build-)
build information as follow: 
        Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
        Branch name: stonedb-5.7-dev
        Last commit ID: 208f79d
        Last commit time: Date:   Sat Sep 17 16:19:42 2022 +0800
        Build time: Date: Sat Sep 17 17:59:04 CST 2022

Are you interested in submitting a PR to solve the problem?

  • [ ] Yes, I will!

shangyanwen avatar Sep 26 '22 08:09 shangyanwen

ACK

duanfuxiang0 avatar Sep 26 '22 08:09 duanfuxiang0

The same problem as #580, has been fixed in #647.

duanfuxiang0 avatar Oct 11 '22 11:10 duanfuxiang0

Regression tests passed

shangyanwen avatar Oct 17 '22 03:10 shangyanwen