title: mysql IF statement problem
body: <p>I  have this  UDF </p>
  
  <pre><code>CREATE FUNCTION merge(user_id INT) RETURNS TEXT
  BEGIN
  DECLARE dsc TEXT;
       IF user_id = 1
        --some SQL statements
        END IF;
      RETURN dsc;
  END//
  </code></pre>
  
  <p>For some reason even if the value of user_id is != 1 --some SQL statements are executed.
  Any ideas ?</p>