procedures the same as they do any other statement. No more multi_query() and
next_result() work arounds necessary to avoid a "Commands out of sync" error.
I note this has been rejected several times in the tracker as not being a bug.
I feel its a clear encapsulation violation making the user special case a
query just because it's calling a stored procedure. Aside from just being
very inconvenient, some API wrappers around mysqli, Drupal 6 for example,
leave the user with no way to get at mysqli::multi_query().
Anyhow, here's a complete patch with a test. The technique and code is lifted
from Perl's DBD::mysql driver, which you can see here as
Before each query it frees any results still hanging around on the connection,
which is essentially what a user has to do. I'm not really a C programmer so
I left most of the code as is, do/while loop and all.
I'm not sure how mysqli normally handles errors so I just went with a printf()
and return trusting that you'll fix that up. It causes test 057 to fail
because that test deliberately generates an out of sync error, which my code
diligently prints. So that should go away with fixed error handling.
THIS I COMMAND!