title: Recursion limit exceeded in non-recusrive procedure
body: <p>I have a procedure which calls another procedure. They never call back to each other or call themselves, but I am getting an error response indicating that they are. The procedures are as follows:</p>
  
  <pre><code>CREATE PROCEDURE grantPermission (perm VARCHAR(30), target VARCHAR(30), id VARCHAR(8), host VARCHAR(45), passwd VARCHAR(45))
    BEGIN 
      SET @setPermissionCmd = CONCAT('GRANT ', perm, ' ON ', target, ' TO ''', id, '''@''', host, ''' IDENTIFIED BY ''', passwd, ''';');
      PREPARE setPermissionStmt FROM @setPermissionCmd;
      EXECUTE setPermissionStmt;
      DEALLOCATE PREPARE setPermissionStmt;
      FLUSH PRIVILEGES;
    END
  </code></pre>
  
  <p>and</p>
  
  <pre><code>CREATE PROCEDURE grantAdmin (id VARCHAR(8), host VARCHAR(45), passwd VARCHAR(45))
    BEGIN
      CALL grantPermission('EXECUTE', 'PROCEDURE createUser', id, host, passwd);
      CALL grantPermission('EXECUTE', 'PROCEDURE grantAdmin', id, host, passwd);
      CALL grantPermission('EXECUTE', 'PROCEDURE revokeAdmin', id, host, passwd);
      CALL grantPermission('INSERT,UPDATE', 'TaskType', id, host, passwd);
      CALL grantPermission('UPDATE', 'User', id, host, passwd);
      UPDATE User SET isAdmin=1 WHERE dbUser=id;
      FLUSH PRIVILEGES;
    END
  </code></pre>
  
  <p>When I call the second procedure, I get the following response:</p>
  
  <pre><code>MariaDB [pattsdb]&gt; CALL grantAdmin('patts', '%', 'patts');
  ERROR 1456 (HY000): Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine grantAdmin
  </code></pre>
  
  <p>Why does it think my procedure is recursive? Just because the name is mentioned in the definition text?</p>