title: create function error in mysql [42000][1064]
body: <p>I want to create a function in MySQL(<strong>version</strong>:5.7.21-log), the code like this:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE FUNCTION uf_sum(left INT, right INT)
    RETURNS INT
    BEGIN
      RETURN left + right;
    END
  </code></pre>
  
  <p>But get an error message:</p>
  
  <pre><code>[2020-01-18 16:01:29] [42000][1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left INT, right INT)
  [2020-01-18 16:01:29] RETURNS INT
  [2020-01-18 16:01:29] BEGIN
  [2020-01-18 16:01:29] RETURN left + right;
  [2020-01-18 16:01:29] END' at line 1
  </code></pre>
  
  <p>I searched on google, got a piece of code, it can be executed correctly:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE FUNCTION sp_cal_max(p_num1 INT, p_num2 INT)
    RETURNS INT
    BEGIN
      IF p_num1 &gt;= p_num2
      THEN
        RETURN p_num1;
      ELSE
        RETURN p_num2;
      END IF;
    END
  </code></pre>
  
  <p>I couldn't find the difference in syntax between this two-piece of SQL, and I couldn't find where's wrong,
  .</p>
  
  <p>Thanks!</p>