title: Why is mySQL Trigger not saving?
body: <p>I'm trying to create a trigger that stops insert if two inserts with same &quot;St_Obr&quot; were already made. It shows no errors, yet when I execute SQL script the trigger doesn't get saved. At least it's not shown when I execute SHOW TRIGGERS;</p>
  <p>Code:</p>
  <pre><code>DELIMITER //
  
  CREATE TRIGGER ob_limit
  BEFORE INSERT ON TUP.Lab FOR EACH ROW
  BEGIN
      SELECT @a = COUNT(*)
      FROM TUP.Lab
      WHERE St_Obr = NEW.St_Obr;
      IF (@a &gt; 2) THEN
          SIGNAL SQLSTATE '45000'
          SET MESSAGE_TEXT = 'MAX 2!';
      END IF;
  END //
  DELIMITER ;
  </code></pre>