Note that there are some explanatory texts on larger screens.

plurals
  1. POMySQL Trigger errors
    text
    copied!<p>I am currently running MySQL ver 5.5.27.</p> <p>I have a script that creates various INSERT, UPDATE and DELETE triggers. The script makes use of drop trigger function in the following way:</p> <pre><code>DROP TRIGGER IF EXISTS trig_Groups_afterUPDATE; </code></pre> <p>Followed by a create trigger..</p> <p>This script works the majority of the time but for no obvious reason it seems to stop working and throwing errors:</p> <pre><code>MySQL Error: (1360) Trigger does not exist </code></pre> <p>Now the reason seems to be because the trigger has been removed from MySQL (confirmed by running the following command: </p> <pre><code>select TRIGGER_NAME from INFORMATION_SCHEMA.TRIGGERS; </code></pre> <p>and this doesn't show the trigger in question) but the corresponding trn and trg files still remain. Whenever I have tested by running the command manually on a trigger that definitely exists in MySQL with the correct corresponding trg and trn files. The command executes successfully and the trg and trn files are also removed (as you would expect). </p> <p>I don't think this is a coding issue but more of environment issue, hence the fact that it works the majority of the time and even worse it seems to work all the time on other machines. </p> <p>Can anybody offer any suggestions. My first thought is that it seems to be some sort of file locking issue. It also seems that 64bit machines exhibit the problem more often so maybe this as something to do with it...</p> <p>Thanks. I apologise if the problem is to vague and am happy to produce some more code if required. </p> <p>Note**</p> <p>Manually deleting the trn file for a trigger that MySQL complains when trying to drop, and re-running the script fixes the issue. So it's definitely seems to be an issue with the trn file being left behind from a previous drop trigger command, that successfully deleted the trigger but not the trn file..</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload