Bug #10455 trigger not firing
Submitted: 9 May 2005 5:24 Modified: 29 Jun 2005 7:35
Reporter: raj k Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:mysql 5.0.3 OS:Windows (windows)
Assigned to: Assigned Account CPU Architecture:Any

[9 May 2005 5:24] raj k
Description:
mysql> create table raj (no int(5),name varchar(10),sal varchar(10));
    -> //
Query OK, 0 rows affected (0.19 sec)
mysql> insert into raj values(2,'bbb',2000);
    -> //
Query OK, 1 row affected (0.05 sec)

creating another table:

mysql> create table raja (no int(5),name varchar(10),sal varchar(10));
    -> //
Query OK, 0 rows affected (0.14 sec)

mysql>  create trigger 1_tr
    ->  after insert on raj
    ->  for each row
    -> begin
    ->   insert into raja(no,name,sal)
    ->   values(1,new.name,1000);
    ->  end;
    -> //
Query OK, 0 rows affected (0.00 sec)

mysql>  insert into raj values(3,'sa',333);
    -> //
Query OK, 1 row affected, 1 warning (0.05 sec)

mysql> show warnings;
    -> //
+-------+------+----------------------------------------------+
| Level | Code | Message                                      |
+-------+------+----------------------------------------------+
| Error | 1100 | Table 'raja' was not locked with LOCK TABLES |
+-------+------+----------------------------------------------+
1 row in set (0.00 sec)

mysql> select * from raja;
    -> //
Empty set (0.02 sec)

How to repeat:
trigger not firing.
1_tr must insert rows into table raja ..when i insert rows in table raj
[10 May 2005 18:56] MySQL Verification Team
Verified on Linux. However I am quite sure if it is a duplicate of another
bug reporter I was unable for to find.

Thank you for the bug report.
[11 May 2005 4:01] raj k
sorry i didn't get u.i tried a lot on other triggers also.same when i did in oracle its working.in my sql its asking for locks ..so pls find out the problem and inform me
[29 Jun 2005 7:35] Dmitry Lenev
Hi, Raj!

Thank you for your intereset in MySQL!

This is duplicate of bug #8406 "Triggers crash if referencing a table"
(Yes, initially this bug caused server crashes but starting from version 5.0.3, it causes only warnings/errors similar to one that you observe.) See http://bugs.mysql.com/bug.php?id=8406 for more info.