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
bug: incorrect result set,Trigger with primary key which assigns value selected from table to field of row,being inserted/updated.Test results are wrong
#581
Closed
1 task
shangyanwen opened this issue
Sep 27, 2022
· 2 comments
· Fixed by #1068
create table t1 (id int primary key, copy int)engine=tianmu;
create table t2 (id int primary key, data int)engine=tianmu;
insert into t2 values (1,1), (2,2);
create trigger t1_bi before insert on t1 for each row
set new.copy= (select data from t2 where id = new.id);
create trigger t1_bu before update on t1 for each row
set new.copy= (select data from t2 where id = new.id);
insert into t1 values (1,3), (2,4), (3,3);
update t1 set copy= 1 where id = 2;
select * from t1;
### Incorrect test results ###
+----+------+
| id | copy |
+----+------+
| 1 | NULL |
| 2 | NULL |
| 3 | NULL |
+----+------+
drop table t1, t2;
Expected behavior
#Correct test results(note:Innodb test verification, test results are as follows)
select * from t1;
+----+------+
| id | copy |
+----+------+
| 1 | 1 |
| 2 | 2 |
| 3 | NULL |
+----+------+
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 assigns value selected from table to field of row,being inserted/updated.Test results are wrong
bug: incorrect result set,Trigger which assigns value selected from table to field of row,being inserted/updated.Test results are wrong
Sep 29, 2022
(gdb) bt
#0fill_record_n_invoke_before_triggers (thd=0x7fd764000e10, ptr=0x7fd76498b910, values=..., table=0x7fd7640ac780, event=TRG_EVENT_INSERT, num_fields=2)
at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/sql_base.cc:9845
#10x00000000025c7ff2 in Sql_cmd_insert::mysql_insert (this=0x7fd764006038, thd=0x7fd764000e10, table_list=0x7fd764005aa8)
at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/sql_insert.cc:760
#20x00000000025cea87 in Sql_cmd_insert::execute (this=0x7fd764006038, thd=0x7fd764000e10) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/sql_insert.cc:3151
#30x00000000023aa84e in mysql_execute_command (thd=0x7fd764000e10, first_level=true) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/sql_parse.cc:3645
#40x00000000023b06fd in mysql_parse (thd=0x7fd764000e10, parser_state=0x7fd962dd1f90) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/sql_parse.cc:5655
#50x00000000023a5694 in dispatch_command (thd=0x7fd764000e10, com_data=0x7fd962dd2730, command=COM_QUERY) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/sql_parse.cc:1495
#60x00000000023a44d5 in do_command (thd=0x7fd764000e10) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/sql_parse.cc:1034
#70x00000000024d5cf3 in handle_connection (arg=0x98dd2a0) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/conn_handler/connection_handler_per_thread.cc:313
#80x0000000002ba303c in pfs_spawn_thread (arg=0x92b7840) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/storage/perfschema/pfs.cc:2197
#90x00007fd96d4891ca in start_thread () from /lib64/libpthread.so.0
#100x00007fd96a7dbe73 in clone () from /lib64/libc.so.6
adofsauron
changed the title
bug: incorrect result set,Trigger which assigns value selected from table to field of row,being inserted/updated.Test results are wrong
bug: incorrect result set,Trigger with primary key which assigns value selected from table to field of row,being inserted/updated.Test results are wrong
Jan 9, 2023
konghaiya
pushed a commit
to konghaiya/stonedb
that referenced
this issue
Mar 7, 2023
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: