title: MySQL - how to fix function creation error 1418
body: <p>Im using mysqlWorkbench</p>
  
  <p>I have followed example work supplied by my tutor and suggestions from other users on this sight but  am now recieving a 1418 error when trying to create the function, as shown in the following:</p>
  
  <blockquote>
    <p>Error Code: 1418. This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you <em>might</em> want to use the less safe log_bin_trust_function_creators variable)    0.00069 sec</p>
  </blockquote>
  
  <p>The function is as follows:</p>
  
  <pre><code>DELIMITER £
  CREATE FUNCTION Calc(ReferenceNumber INTEGER)
  RETURNS INTEGER
  
  BEGIN 
  DECLARE NUMCATS INTEGER;
      SELECT SUM(BOOKCAT.Ref = ReferenceNumber) INTO NUMCATS
      FROM CATTERY.BOOKCAT;
      RETURN NUMCATS;
  END £
  DELIMITER ;
  
  select calc(7);
  </code></pre>
  
  <p>Let me know what i am doing wrong and how to correct it, thanks.</p>