You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create table t1 (id int primary key, fk_t2 int)engine=tianmu;
create table t2 (id int primary key, fk_t3 int)engine=tianmu;
create table t3 (id int primary key)engine=tianmu;
insert into t1 values (1,1), (2,1), (3,2);
insert into t2 values (1,1), (2,2);
insert into t3 values (1), (2);
create trigger t3_ad after delete on t3 for each row
delete from t2 where fk_t3=old.id;
create trigger t2_ad after delete on t2 for each row
delete from t1 where fk_t2=old.id;
delete from t3 where id = 1;
select * from t1 left join (t2 left join t3 on t2.fk_t3 = t3.id) on t1.fk_t2 = t2.id;
#Incorrect test results
+----+-------+------+-------+------+
| id | fk_t2 | id | fk_t3 | id |
+----+-------+------+-------+------+
| 1 | 1 | 2 | 2 | 2 |
| 2 | 1 | 2 | 2 | 2 |
| 3 | 2 | 2 | 2 | 2 |
+----+-------+------+-------+------+
drop table t1, t2, t3;
Expected behavior
select * from t1 left join (t2 left join t3 on t2.fk_t3 = t3.id) on t1.fk_t2 = t2.id;
+----+-------+------+-------+------+
| id | fk_t2 | id | fk_t3 | id |
+----+-------+------+-------+------+
| 3 | 2 | 2 | 2 | 2 |
+----+-------+------+-------+------+
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!
The text was updated successfully, but these errors were encountered:
shangyanwen
changed the title
bug: Trigger which forces invocation of another trigger,emulation of FK on delete cascade policy,Delete does not take effect
bug: incorrect result set.Trigger which forces invocation of another trigger,emulation of FK on delete cascade policy,Delete does not take effect
Sep 29, 2022
Describe the problem
Expected behavior
How To Reproduce
Environment
Are you interested in submitting a PR to solve the problem?
The text was updated successfully, but these errors were encountered: