title: InterfaceError: No result set to fetch from. with python and mysql.connector
body: <p>I have prepared a stored procedure that runs fine if I make the call from a MySQL console. But when running in python with <code>mysql.connector</code> controller, performs the insertion procedure correctly. </p>
  
  <p>However, the result does not bring with <code>fectchall()</code> because the following error:</p>
  
  <pre><code>File "/home/sis1/prueba/prueba.py", line 16, in &lt;module&gt;
      reg=conn.fetchall()
    File "/usr/lib/pymodules/python2.7/mysql/connector/cursor.py", line 551, in fetchall
      raise errors.InterfaceError("No result set to fetch from.")
  InterfaceError: No result set to fetch from.`
  </code></pre>
  
  <p>Here's the stored procedure:</p>
  
  <pre><code>DROP PROCEDURE IF EXISTS pr_prueba;    
  CREATE DEFINER = rooter@localhost PROCEDURE pr_prueba(IN p_emp tinyint,OUT mensaje varchar(50),OUT registros integer)    
  BEGIN    
      DECLARE numreg INT (10);    
      DECLARE tabla VARCHAR (30);     
      DECLARE emp TINYINT(2);    
      SET @tabla = CONCAT("emp",p_emp,".usuario");    
      SET @emp = CAST(p_emp AS UNSIGNED);    
      SET @sql_text = CONCAT("INSERT INTO ",@tabla," ( name, lastname ) (SELECT UPPER(name), UPPER(lastname) FROM tablas GROUP BY tablas.operador);");    
      PREPARE stmt FROM @sql_text;    
      EXECUTE stmt;    
      DEALLOCATE PREPARE stmt;    
      SET @mensaje="OK";    
      SET @sql_text = CONCAT("SELECT COUNT(*) INTO @numreg FROM ",@tabla,";");    
      PREPARE stmt FROM @sql_text;    
      EXECUTE stmt;    
      DEALLOCATE PREPARE stmt;    
      SET @registros=@numreg;    
      SELECT @mensaje as mensaje, @registros as registros;    
  END ;
  </code></pre>
  
  <p>Here's python code:</p>
  
  <pre><code>import sys    
  import mysql.connector    
  if (__name__=='__main__'):    
    db = mysql.connector.connect(host="192.168.1.1",user="de",passwd="de2",database="dbim" )    
    conn = db.cursor()    
    args=(1,"",0)    
    conn.callproc("pr_prueba",args)    
    reg=conn.fetchall()    
    try:    
      db.commit()    
    except:    
      db.rollback()    
      print "error"    
    conn.close()    
    db.close()
  </code></pre>