Re: How to alter a trigger atomicly?
Temporarily renaming the table appears to work. Changes to mytable from other threads will fail.
DELIMITER $$
ALTER TABLE `mytable` RENAME TO `mytable_locked` $$
DROP TRIGGER IF EXISTS `mytable_ait` $$
CREATE TRIGGER `mytable_ait` AFTER INSERT ON `mytable_locked`
FOR EACH ROW
BEGIN
...
END $$
ALTER TABLE `mytable_locked` RENAME TO `mytable` $$
DELIMITER ;
Subject
Views
Written By
Posted
15288
March 19, 2007 09:53PM
5967
April 05, 2007 07:27AM
5828
April 06, 2007 03:03AM
4686
April 19, 2007 02:56AM
Re: How to alter a trigger atomicly?
3812
March 02, 2009 03:12AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.