title: SQL syntax error when creating a stored procedure in MySQL
body: <p>I have a hard time locating an error when trying to create a stored procedure in mysql.</p>
  
  <p>If I run every single line of the procedure independently, everything works just fine.</p>
  
  <pre><code>CREATE PROCEDURE cms_proc_add_child 
  (
      param_parent_id INT, param_name CHAR(255),
      param_content_type CHAR(255)
  )
  BEGIN
      SELECT @child_left := rgt FROM cms_tree WHERE id = param_parent_id;
      UPDATE cms_tree SET rgt = rgt+2 WHERE rgt &gt;= @child_left;
      UPDATE cms_tree SET lft = lft+2 WHERE lft &gt;= @child_left;
      INSERT INTO cms_tree (name, lft, rgt, content_type) VALUES 
      (
          param_name,
          @child_left,
          @child_left+1,
          param_content_type
      );
  END
  </code></pre>
  
  <p>I get the following (helpful) error: </p>
  
  <blockquote>
    <p>ERROR 1064 (42000): 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 '' at line 3</p>
  </blockquote>
  
  <p>I just don't know where to start debugging, as every single one of these lines is correct.</p>
  
  <p>Do you have any tips?</p>