title: MySQL function is returning wrong value
body: <p>I have a function with 4 parameters and for example if I set null/empty value for the first parameter which is type DATE I get the result 2 instead of 1.</p>
  <pre><code>SET @p0=''; SET @p1=''; SET @p2=''; SET @p3=''; SELECT `MY_FN`(@p0, @p1, @p2, @p3) AS `MY_FN`;
  </code></pre>
  <p>My code:</p>
  <pre><code>BEGIN
   IF PARAM1_DATE IS NULL or PARAM1_DATE='' THEN 
          SET @STATUS = 1;
      ELSE 
          SET @STATUS = 2;
      END IF;
      
      
      RETURN @STATUS;
  END
  </code></pre>
  <p>I've tried also ISNULL(NULLIF(PARAM1_DATE,'') same result</p>