List:General Discussion« Previous MessageNext Message »
From:Gleb Paharenko Date:December 27 2005 3:56pm
Subject:Re: 5.0.16. Bug in triggers?
View as plain text  
Privet!

This seems as a bug, especially because with InnoDB tables bulk
insert works fine. You may add your comments at:
  http://bugs.mysql.com/bug.php?id=16021




Juri Shimon wrote:
> Hello mysql,
> 
>   When trigger on table uses select from same table, then bulk insert into
>   this table cause error.
> 
> How to repeat:
> 
> create table t(i int not null, j int not null, n numeric(15,2), primary key(i,j));
> create table s(i int not null, n numeric(15,2), primary key(i));
> 
> delimiter //
> create trigger t_ai after insert on t for each row begin
>     declare sn numeric(15,2);
>     select sum(n) into sn from t where i=new.i;
>     replace into s values(new.i, sn);
> end//
> delimiter ;//
> 
> insert into t 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);
> 
> 
>>ERROR 1030 (HY000) at line 12: Got error 124 from storage engine
> 
> 
> 1. Without "select sum(n) into sn from t" all OK.
> 2. insert into t values
>        (1,1,10.00),(1,2,10.00),(1,3,10.00),(1,4,10.00),(1,5,10.00);
>    - all OK.
> 
>   Is this a bug?
> 


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   Gleb.Paharenko@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com



Thread
5.0.16. Bug in triggers?Juri Shimon26 Dec
  • Re: 5.0.16. Bug in triggers?Gleb Paharenko27 Dec