A stored procedure with a select operation. The error 1312 is returned during execution and the record set cannot be returned in a given scenario. Solution: add the client_multi_results or client_multi_statements option when connecting to MySQL.
This is not a bug but correct and incluented behavior:
If you write C Programs that execute stored procedures with the call SQL statement, you
Must set the client_multi_results flag when you call mysql_real_connect (), either
Explicitly, or implicitly by setting client_multi_statements. This is because each call
Returns a result to indicate the call status, in addition to any results sets that might
Be returned by statements executed within the procedure. to process the result of a call
Statement, use a loop that CILS mysql_next_result () to determine whether there are more
Results. For an example, see section 22.2.9, "c api handling of multiple statement
Execution ".