title: MySQL Error 2014 - Commands out of sync - when trying to call consecutive stored procs
body: <p>I have a hierarchical MySQL table setup using the Nested Set model.  I have created a stored proc which allows me to delete an organization.</p>
  
  <p>When I try making consecutive calls to the stored proc, I get the following error referring to the second CALL command:</p>
  
  <blockquote>
    <p>2014 - Commands out of sync; you can't run this command now </p>
  </blockquote>
  
  <p>Here is the SQL I am running:</p>
  
  <pre><code>SELECT @id := id, 
         @parent_id := parent_id 
    FROM organization 
   WHERE name = 'TESTDEAL';
  
  CALL deleteOrg(@id);
  CALL deleteOrg(@parent_id);
  </code></pre>
  
  <p>And here is my Stored Procedure:</p>
  
  <pre><code>DELIMITER $$
  
  CREATE PROCEDURE deleteOrg(IN IN_ID INT)
  
  MODIFIES SQL DATA
  
  BEGIN 
  
      START TRANSACTION;
  
      SELECT @org_id := id, 
             @myLeft := lft, 
             @myRight := rgt,  
             @myWidth := rgt - lft + 1 
        FROM organization 
       WHERE id = IN_ID;
  
      # delete statements for removing roles and other dependencies
  
      DELETE FROM organization 
       WHERE id = @org_id;
  
      UPDATE organization 
         SET rgt = rgt - @myWidth 
       WHERE rgt &gt; @myRight;
  
      UPDATE organization 
         SET lft = lft - @myWidth 
       WHERE lft &gt; @myRight;
  
      COMMIT;
  
  END;
  $$
  
  DELIMITER ;
  </code></pre>
  
  <p>Why would the second command be failing?  Is MySQL trying to execute the second CALL command before the first one has been committed?  Is there a way I can force the first one to fully execute before calling the second?</p>
  
  <p>EDIT: organization table is using InnoDB</p>
  
  <p>EDIT: Tried removing START TRANSACTION; and COMMIT; but am still getting same error</p>