diff options
author | unknown <dlenev@mysql.com> | 2006-04-19 19:13:03 +0400 |
---|---|---|
committer | unknown <dlenev@mysql.com> | 2006-04-19 19:13:03 +0400 |
commit | de76dd3a1fe0f815abf221d4052fbbb0d17caaee (patch) | |
tree | 650b045f316e23afc43d53d4d700f57d2c6251c2 /mysql-test/t/trigger.test | |
parent | fb62bcb0021b1ac7425e3ddfc41d6458e1f76aac (diff) | |
download | mariadb-git-de76dd3a1fe0f815abf221d4052fbbb0d17caaee.tar.gz |
Added test case for bug #16021 "Wrong index given to function in trigger"
which was caused by the same bulk insert optimization as bug #17764 but
had slightly different symptoms.
Diffstat (limited to 'mysql-test/t/trigger.test')
-rw-r--r-- | mysql-test/t/trigger.test | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index a0b67b2204d..ae05d70bf67 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -1111,11 +1111,35 @@ insert into t1 values create function f2() returns int return (select max(b) from t2); insert into t2 select a, f2() from t1; load data infile '../std_data_ln/words.dat' into table t1 (a) set b:= f1(); -drop table t1; +drop tables t1, t2; drop function f1; drop function f2; # +# Test for bug #16021 "Wrong index given to function in trigger" which +# was caused by the same bulk insert optimization as bug #17764 but had +# slightly different symptoms (instead of reporting table as crashed +# storage engine reported error number 124) +# +create table t1(i int not null, j int not null, n numeric(15,2), primary key(i,j)); +create table t2(i int not null, n numeric(15,2), primary key(i)); +delimiter |; +create trigger t1_ai after insert on t1 for each row +begin + declare sn numeric(15,2); + select sum(n) into sn from t1 where i=new.i; + replace into t2 values(new.i, sn); +end| +delimiter ;| +insert into t1 values + (1,1,10.00),(1,2,10.00),(1,3,10.00),(1,4,10.00),(1,5,10.00), + (1,6,10.00),(1,7,10.00),(1,8,10.00),(1,9,10.00),(1,10,10.00), + (1,11,10.00),(1,12,10.00),(1,13,10.00),(1,14,10.00),(1,15,10.00); +select * from t1; +select * from t2; +drop tables t1, t2; + +# # Test for Bug #16461 connection_id() does not work properly inside trigger # --disable_warnings |