At 21:24 -0600 7/14/05, Warren Young wrote:
When you have a stored procedure that returns a result set, it seems
that the server returns its results the same way as with a
multi-query. As a result, if you don't set the multi-query option
when setting up the connection with the C API, the server refuses to
return the result set. You get this error:
PROCEDURE foo can't return a result set in the given context
If you set this flag in the mysql_real_connect() call, the stored
procedure works fine. But if you set it with
mysql_set_server_option(), only regular multi-queries work fine;
stored procedures returning result sets still fail. According to
this manual page:
http://dev.mysql.com/doc/mysql/en/c-api-multiple-queries.html
the two invocations should be equivalent.
They are equivalent -- for executing statements.
But to retrieve results, you also need the CLIENT_MULTI_RESULTS
flag in mysql_real_connect(). The CLIENT_MULTI_STATEMENTS flag automatically
enables CLIENT_MULTI_RESULTS, which is why you see the behavior that you do.
Due to the way my program is structured, it is highly inconvenient
to set this flag in the real_connect call. I would much rather set
it on the connection after it is established.
Is there a good reason why the server behaves differently than the
manual indicates, or is it a bug?
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]