Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task
shangyanwen opened this issue Sep 26, 2022 · 3 comments
Closed
1 task
Assignees
Labels
A-bug Something isn't working

Comments

@shangyanwen
Copy link
Contributor

shangyanwen commented Sep 26, 2022

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 shangyanwen added the A-bug Something isn't working label Sep 26, 2022
@shangyanwen shangyanwen changed the title bug: Before delete trigger,The query result is empty bug: Before delete trigger,Does not take effect Sep 26, 2022
@duanfuxiang0
Copy link
Contributor

ACK

@shangyanwen shangyanwen added this to the stonedb_5.7_v1.0.1 milestone Sep 26, 2022
@shangyanwen shangyanwen changed the title bug: Before delete trigger,Does not take effect bug: incorrect result set.Before delete trigger,Does not take effect Sep 29, 2022
@duanfuxiang0 duanfuxiang0 self-assigned this Oct 4, 2022
@duanfuxiang0
Copy link
Contributor

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

@shangyanwen
Copy link
Contributor Author

Regression tests passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants