The relevant section from the manual:
"The multiple statement and result capabilities can be used only with mysql_query() or mysql_real_query(). They cannot be used with the prepared statement interface. Prepared statement handles are defined to work only with strings that contain a single statement. See Section 22.8.4, “C API Prepared Statements”." http://dev.mysql.com/doc/refman/5.5/en/c-api-multiple-queries.html
So the answer is "you cannot call a stored procedure from mysql_stmt_query() if you want any results" :(
In order to do what you want to do (use CALL) you have to do the escaping manually yourself, and use curs.execute("CALL foo(1,2,3)", plain_query=True)
At this point, I've traced this down to 'mysql_ stmt_result_ metadata( stmt)' returning NULL when a stored procedure is called.
According to some bug reports, bugs.mysql. com/bug. php?id= 42490 bugs.mysql. com/bug. php?id= 19008 bugs.mysql. com/bug. php?id= 11918
http://
http://
http://
The relevant section from the manual: dev.mysql. com/doc/ refman/ 5.5/en/ c-api-multiple- queries. html
"The multiple statement and result capabilities can be used only with mysql_query() or mysql_real_query(). They cannot be used with the prepared statement interface. Prepared statement handles are defined to work only with strings that contain a single statement. See Section 22.8.4, “C API Prepared Statements”."
http://
So the answer is "you cannot call a stored procedure from mysql_stmt_query() if you want any results" :(
In order to do what you want to do (use CALL) you have to do the escaping manually yourself, and use curs.execute("CALL foo(1,2,3)", plain_query=True)