Bug #25563 | Nested Triggers Produce Non-Existant Table | ||
---|---|---|---|
Submitted: | 11 Jan 2007 23:39 | Modified: | 4 Jun 2007 4:10 |
Reporter: | Matthew Boehm | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Cluster: Cluster (NDB) storage engine | Severity: | S2 (Serious) |
Version: | 5.0.27 | OS: | Linux (RHEL4) |
Assigned to: | CPU Architecture: | Any | |
Tags: | cluster, nested, table, triggers |
[11 Jan 2007 23:39]
Matthew Boehm
[11 Jan 2007 23:40]
Matthew Boehm
every table referenced in the queries does exist btw..
[27 Apr 2007 2:02]
Adam Dixon
Can you provide the following output; mysql> SHOW TRIGGERS\G
[27 Apr 2007 2:37]
Matthew Boehm
[omnovia_conf]>show triggers\G *************************** 1. row *************************** Trigger: meetings_deleter Event: DELETE Table: meetings Statement: BEGIN DELETE FROM attedance WHERE meetingNo = OLD.no; END Timing: BEFORE Created: NULL sql_mode: Definer: root@localhost *************************** 2. row *************************** Trigger: room_deleter Event: DELETE Table: rooms Statement: BEGIN DELETE FROM archivedmovies WHERE roomID = OLD.roomID; DELETE FROM bannedusers WHERE roomID = OLD.roomID; DELETE FROM bufferseats WHERE roomID = OLD.roomID; DELETE FROM meetings WHERE roomID = OLD.roomID; DELETE FROM events WHERE roomID = OLD.roomID; DELETE FROM favoritelinks WHERE roomID = OLD.roomID; DELETE FROM onetime_passwords WHERE roomID = OLD.roomID; DELETE FROM roomsounds WHERE roomID = OLD.roomID; DELETE FROM savedannouncements WHERE roomID = OLD.roomID; DELETE FROM savedsurveys WHERE roomID = OLD.roomID; DELETE FROM smsreports WHERE roomID = OLD.roomID; DELETE FROM smsusers WHERE roomID = OLD.roomID; DELETE FROM spreadsheets WHERE roomID = OLD.roomID; DELETE FROM subscriptions WHERE custom = OLD.roomID; DELETE FROM users_rooms WHERE roomID = OLD.roomID; END Timing: BEFORE Created: NULL sql_mode: Definer: root@localhost 2 rows in set (0.30 sec)
[27 Apr 2007 2:44]
Matthew Boehm
Because this bug is so old, I didn't see what I was originally referring to. Looking over this again I see the issue: If you delete a row from the `rooms` table, one of the lines in the 'room_deleter' trigger will DELETE FROM `meetings`. The `meetings` table has its own trigger that will delete from `attendance` (faking a foreign key relationship). For whatever reason, having these two triggers present at the same time will produce the 'table not found' issue. Further adding to this is that the SQL that I am running to produce this error is NOT a DELETE but an UPDATE and as you can see, neither trigger are supposed to respond to UPDATE statements.
[27 Apr 2007 3:27]
Adam Dixon
Hello Matthew, This is what I was trying to clarify by SHOW TRIGGERS, If you still have your full trigger set (schema would be nice too) I can still try and reproduce the table error to see if this is a bug too. Otherwise nothing else to do here.
[27 Apr 2007 3:31]
Matthew Boehm
giving the three relevant ones...let me know what else you need cause I don't see how this isn't a bug... CREATE TABLE `attendance` ( `no` int(11) NOT NULL auto_increment, `meetingNo` int(11) NOT NULL default '0', `name` varchar(40) NOT NULL default '', `email` varchar(50) NOT NULL default '', `phone` varchar(17) default NULL, `role` tinyint(4) NOT NULL default '0', `companyCustomData` varchar(100) default NULL, `entryTime` datetime NOT NULL default '0000-00-00 00:00:00', `reentryTime` datetime NOT NULL default '0000-00-00 00:00:00', `duration` int(6) NOT NULL default '-1', `sessionEnded` smallint(6) NOT NULL default '0', `ipaddress` int(11) unsigned default NULL, PRIMARY KEY (`no`), KEY `meetingNo` (`meetingNo`) ) ENGINE=MyISAM AUTO_INCREMENT=669043 DEFAULT CHARSET=latin1 ////////////// CREATE TABLE `meetings` ( `no` int(11) NOT NULL auto_increment, `roomID` int(11) NOT NULL default '0', `startTime` datetime NOT NULL default '0000-00-00 00:00:00', `ended` tinyint(4) NOT NULL default '0', `duration` int(11) NOT NULL default '0', `history` mediumtext NOT NULL, `announcementHistory` text NOT NULL, `SMSHistory` text NOT NULL, PRIMARY KEY (`no`), KEY `roomIDEnded` (`roomID`,`ended`) ) ENGINE=MyISAM AUTO_INCREMENT=71373 DEFAULT CHARSET=latin1 //////////// CREATE TABLE `rooms` ( `roomID` int(4) NOT NULL auto_increment, `shorturl` varchar(40) NOT NULL default '', `name` varchar(30) NOT NULL default '', `companyID` int(11) NOT NULL default '0', `isTrial` tinyint(4) NOT NULL default '0', `nbVideo` tinyint(4) NOT NULL default '1', `defaultVideoQuality` tinyint(4) NOT NULL default '2', `allowBigLiveVideo` tinyint(1) NOT NULL default '0' PRIMARY KEY (`roomID`), UNIQUE KEY `shorturl_2` (`shorturl`,`companyID`), KEY `companyIDFK` (`companyID`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
[27 Apr 2007 3:34]
Matthew Boehm
Just for simplicity sake, you can trim down the room_deleter trigger to just this.. CREATE TRIGGER `room_deleter` BEFORE DELETE ON `rooms` FOR EACH ROW BEGIN DELETE FROM meetings WHERE roomID = OLD.roomID; END; ;; and the problem still exists.
[30 Apr 2007 18:57]
Marc ALFF
The symptom seems related to Bug#8407, which has been fixed in 5.0.38 and 5.1.17. Please use 5.0.38 or better when trying to reproduce this.
[30 Apr 2007 19:03]
Matthew Boehm
Ok. I will find some time this week to upgrade to 5.0.38 and will report back.
[4 May 2007 4:10]
Adam Dixon
Please provide your feedback - when you have it. Thanks.
[4 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".