Bug #28131 trigger have some problem
Submitted: 27 Apr 2007 10:16 Modified: 10 Jun 2007 18:20
Reporter: subramanian sethuraj Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:'5.0.15-nt' OS:Windows
Assigned to: CPU Architecture:Any

[27 Apr 2007 10:16] subramanian sethuraj
Description:
When both an event and a  trigger are active on a table.
My question is

I create one table with three columns 

Table Name           :Table1

Field Name  A1   int, b1 varchar (10), c1 int

A1                    b1                     c1
1                     ma                      0
2                     sam                     1
3                     sdf                     0
4                     sdf                     3

A1 value can be stored in c1 column (i.e exactly foreign key releation ship).
If i am pasing query delete from table1 where a1=1
 If now deleting the record that time i can check to c1 any value = 1 is there
first delete the row and finally the  delete the condition wise.
is it possible in trigger in mysql 5.0.15-nt?

A1                    b1                     c1
1                     ma                      0    --condition wise
2                     sam                     1    --First delete
3                     sdf                     0
4                     sdf                     3

finally i will get output in
A1                    b1                     c1
3                     sdf                     0
4                     sdf                     3

I create trigger also
Create trigger tr1 before delete on table1
for each row begin
delete from table1 where c1=old.a1
end;

Trigger is executing perfectly, but i run the query

delete from table1 where a1=1;

some error is coming

Can't update table 'table1' in stored function/trigger because it is already
used by statement which invoked this stored function/trigger.

please give me the solution it's very urgent and send me the answer
in sai_subramani@yahoo.co.in

How to repeat:
1
[27 Apr 2007 11:10] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newerr version, 5.0.37, and inform about the results.
[10 May 2007 11:06] subramanian sethuraj
I am new in my sql. Now i am using 5.0.15nt+ GuI. How to update 5.0.37.
where do you download the 5.0.35. Please tell me the Exact url as soon as possible.

Actually i have to face the problem for the past 15 days. I am not able to solve this problem. It's very urgent.
[10 May 2007 18:20] Valeriy Kravchuk
We had already released 5.0.41 in the meantime. You can download it from:

http://dev.mysql.com/downloads/mysql/5.0.html

For example, if you have 32-bit Windows, you may download:

http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.41-win32.zip/from/pick
[10 Jun 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".